:root {
  color: #243b4a;
  background: #dfe9ee;
  font-family: "MS PGothic", "Yu Gothic UI", Meiryo, sans-serif;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background-color: #dfe9ee;
  background-image:
    radial-gradient(circle at 1px 1px, rgb(86 117 134 / 14%) 1px, transparent 1.5px),
    linear-gradient(135deg, rgb(255 255 255 / 42%), rgb(208 222 229 / 35%));
  background-size: 13px 13px, auto;
}

a { color: #0645ad; text-decoration: underline; }
a:visited { color: #5b3d91; }
a:hover,
a:focus-visible { color: #b52f46; }

.personal-site {
  width: min(calc(100% - 26px), 900px);
  min-height: 100vh;
  margin: 18px auto;
  padding: 0 12px 24px;
  border: 1px solid #6c8998;
  background: #fff;
  box-shadow: 3px 3px 0 rgb(77 104 119 / 30%);
}

.personal-topline {
  margin: 0 -12px;
  padding: 6px 12px;
  border-bottom: 1px solid #afc2cb;
  color: #4e6979;
  background: #e8f2f6;
  font-size: 0.7rem;
  line-height: 1.4;
}

.personal-header {
  margin-top: 14px;
  padding: 18px 20px 16px;
  border: 2px solid #6f94a6;
  background: linear-gradient(180deg, #fbffff 0%, #d9edf4 100%);
}

.compact-header { padding-bottom: 18px; }

.personal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.personal-kicker {
  margin: 0 0 6px;
  color: #5d7e8c;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.personal-header h1 {
  margin: 0;
  color: #07558b;
  font-family: Verdana, "MS Gothic", sans-serif;
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 1px 1px 0 #fff;
}

.personal-subtitle {
  margin: 5px 0 0;
  color: #537180;
  font-size: 0.8rem;
}

.update-badge {
  min-width: 106px;
  padding: 8px 10px;
  border: 1px dashed #c5823f;
  color: #745027;
  background: #fff4cf;
  font-size: 0.7rem;
  line-height: 1.55;
  text-align: center;
  transform: rotate(1deg);
}

.update-badge strong { font-size: 0.9rem; }

.personal-intro {
  margin: 14px 0 0;
  padding-top: 11px;
  border-top: 1px dotted #9ab3be;
  color: #3d5b6a;
  font-size: 0.84rem;
  line-height: 1.75;
}

.personal-nav {
  display: flex;
  flex-wrap: wrap;
  margin: 12px 0 22px;
  border: 1px solid #47768b;
  background: linear-gradient(#4d8aa3, #2d6680);
}

.personal-nav a {
  padding: 8px 16px;
  border-right: 1px solid rgb(255 255 255 / 45%);
  color: #fff;
  font-size: 0.78rem;
  text-decoration: none;
  text-shadow: 1px 1px 0 #275366;
}

.personal-nav a:hover,
.personal-nav a:focus-visible {
  color: #fffbd2;
  background: #1e5269;
}

.personal-content { padding: 0 4px; }

.personal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 17px;
}

.personal-box {
  margin-top: 15px;
  border: 1px solid #91aeb9;
  background: #fff;
}

.personal-grid > div > .personal-box:first-child,
.personal-sidebar > .personal-box:first-child,
.personal-content > .personal-box:first-child { margin-top: 0; }

.box-title {
  padding: 8px 12px;
  border-bottom: 1px solid #a8c0ca;
  color: #135c80;
  background: linear-gradient(90deg, #dceff5, #f3fafb);
  font-size: 0.92rem;
  font-weight: 700;
}

.box-title span { color: #d07835; }

.box-body {
  padding: 14px 15px;
  color: #3e535e;
  font-size: 0.82rem;
  line-height: 1.9;
}

.box-body p { margin: 0 0 10px; }
.box-body p:last-child { margin-bottom: 0; }

.welcome-box { border-color: #c8a561; }
.welcome-box .box-title { color: #7b5b22; background: linear-gradient(90deg, #fff0ba, #fffdf0); }
.update-box { border-color: #c58b73; }
.update-box .box-title { color: #87452d; background: linear-gradient(90deg, #ffe5da, #fff7f2); }

.small-note {
  color: #718089;
  font-size: 0.73rem;
}

.link-list { padding: 4px 0; }

.link-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px dotted #b6c6cc;
  font-size: 0.82rem;
}

.link-list a:last-child { border-bottom: 0; }
.link-list strong { font-weight: 700; }
.link-list span { color: #6b7d84; font-size: 0.72rem; }

.profile-box { border-color: #8da9b6; }
.profile-box .box-body { background: #f7fbfc; }
.profile-box strong { color: #426979; }
.small-link { display: inline-block; margin-top: 7px; font-size: 0.74rem; }

.memo-box { border-color: #b0a1bd; }
.memo-box .box-title { color: #5b4b71; background: linear-gradient(90deg, #eee9f6, #fbfaff); }
.counter-label { color: #778187; font-size: 0.72rem; text-align: center; }
.visitor-counter {
  width: fit-content;
  margin: 4px auto !important;
  padding: 2px 8px;
  border: 1px inset #a8afb2;
  color: #2f3e46;
  background: #e5e8e8;
  font-family: "Courier New", monospace;
  font-size: 1rem;
  letter-spacing: 0.14em;
}

.personal-breadcrumb {
  margin: 0 0 11px;
  color: #74828a;
  font-size: 0.72rem;
}

.personal-document { position: relative; }
.document-stamp {
  position: absolute;
  top: 8px;
  right: 11px;
  padding: 2px 7px;
  border: 1px dotted #b66c3e;
  color: #9b5a35;
  background: #fff9e8;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  transform: rotate(2deg);
}

.personal-document > .box-title { padding-right: 100px; }
.document-date { color: #a15c3a; font-size: 0.73rem; }

.record-list { margin: 15px 0 0; }

.record-list > div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dotted #bdcbd0;
}

.record-list dt { color: #6d818a; font-size: 0.74rem; }
.record-list dd { margin: 0; color: #334e5b; font-size: 0.8rem; }

.record-note {
  margin-top: 18px;
  padding: 12px 13px;
  border-left: 3px solid #79a3b4;
  background: #edf6f8;
}

.record-note h2 {
  margin: 0 0 8px;
  color: #2e667b;
  font-size: 0.9rem;
}

.record-note p { font-size: 0.8rem; }

.personal-lock-panel {
  margin-top: 17px;
  padding: 17px 18px 18px;
  border: 1px solid #c58b73;
  background: #fff8e8;
}

.personal-lock-panel h2 {
  margin: 0 0 7px;
  color: #7b4e32;
  font-size: 1rem;
}

.personal-lock-panel > p {
  margin-bottom: 0;
  font-size: 0.8rem;
}

.report-unlock-form {
  max-width: 530px;
  margin-top: 14px;
  padding: 13px 14px 14px;
  border: 1px solid #b9a18c;
  background: #fff;
}

.report-unlock-form label {
  display: block;
  margin-bottom: 6px;
  color: #5e4839;
  font-size: 0.8rem;
  font-weight: 700;
}

.report-unlock-form > div {
  display: flex;
  gap: 8px;
}

.report-unlock-form input {
  min-width: 0;
  flex: 1;
  border: 2px solid #8f9fa3;
  padding: 10px 11px;
  color: #334e5b;
  background: #fff;
}

.report-unlock-form input:focus {
  border-color: #c45c4a;
  outline: 2px solid rgb(196 92 74 / 16%);
  outline-offset: 1px;
}

.report-unlock-form button {
  flex: none;
  border: 1px solid #b94f3d;
  padding: 0 15px;
  color: #fff;
  background: #b94f3d;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.report-unlock-form button:hover,
.report-unlock-form button:focus-visible {
  background: #8f3f32;
}

.report-error {
  color: #a83b32 !important;
  font-size: 0.76rem !important;
}

.report-body {
  margin-top: 18px;
  padding: 16px 17px 18px;
  border: 1px solid #91aeb9;
  background: #f7fbfc;
}

.report-body[hidden],
.personal-lock-panel[hidden] { display: none; }

.report-body-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px dotted #9eb4bc;
  color: #2e667b;
  font-size: 0.78rem;
}

.report-body-heading span { color: #6c7d83; }
.report-body > p { font-size: 0.82rem; }

.report-entry-link {
  display: inline-block;
  margin-top: 3px;
  padding: 5px 8px;
  border: 1px solid #9ab2bd;
  background: #f2f8fa;
  font-size: 0.78rem;
  font-weight: 700;
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.record-tags span {
  padding: 4px 7px;
  border: 1px solid #b8c4ca;
  color: #496875;
  background: #f5f7f3;
  font-size: 0.7rem;
}

.small-box { max-width: 650px; }

.history-document { margin-top: 0; }

.history-row {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px dotted #bdcbd0;
}

.history-row:first-child { padding-top: 0; }
.history-row:last-child { padding-bottom: 0; border-bottom: 0; }
.history-row time { color: #aa5e3a; font-family: "Courier New", monospace; font-size: 0.75rem; }
.history-row strong { color: #275c73; font-size: 0.84rem; }
.history-row p { margin-top: 4px; font-size: 0.76rem; }

.note-list { margin-top: 0; }

.note-entry {
  padding: 14px 2px 17px;
  border-bottom: 1px dotted #b8c9cf;
}

.note-entry:first-child { padding-top: 0; }
.note-entry:last-child { padding-bottom: 0; border-bottom: 0; }
.note-date { margin: 0 0 3px !important; color: #a45a37; font-family: "Courier New", monospace; font-size: 0.75rem !important; }
.note-entry h2 { margin: 0 0 5px; color: #245e77; font-size: 0.98rem; }
.note-entry p:last-child { font-size: 0.8rem; }

.note-photo {
  max-width: 430px;
  margin: 12px 0 13px;
  padding: 5px;
  border: 1px solid #aab9bf;
  background: #f5f7f4;
}

.note-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d1d9da;
}

.note-photo figcaption {
  margin: 5px 2px 1px;
  color: #687b82;
  font-size: 0.7rem;
  line-height: 1.5;
}

.personal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 25px;
  padding-top: 12px;
  border-top: 1px dotted #9eb3bc;
  color: #79868c;
  font-size: 0.67rem;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .personal-site { width: min(calc(100% - 14px), 900px); margin: 7px auto; padding: 0 8px 18px; }
  .personal-topline { margin: 0 -8px; padding-right: 8px; padding-left: 8px; }
  .personal-header { margin-top: 10px; padding: 14px 13px; }
  .personal-title-row { gap: 10px; }
  .update-badge { min-width: 88px; padding: 6px 6px; }
  .personal-nav { margin-bottom: 16px; }
  .personal-nav a { flex: 1 1 33%; padding: 8px 5px; text-align: center; }
  .personal-grid { display: block; }
  .personal-sidebar { margin-top: 15px; }
  .personal-grid > div > .personal-box:first-child { margin-top: 0; }
  .record-list > div,
  .history-row { grid-template-columns: 1fr; gap: 3px; }
  .report-unlock-form > div { display: block; }
  .report-unlock-form button { width: 100%; min-height: 38px; margin-top: 7px; }
  .report-body-heading { display: block; }
  .report-body-heading span { display: block; margin-top: 4px; }
  .personal-footer { display: block; }
  .personal-footer span { display: block; }
  .personal-footer span + span { margin-top: 4px; }
}
