:root {
  --navy: #0b2a5b;
  --navy-deep: #071e42;
  --navy-soft: #1b3f78;
  --gold: #c4a04a;
  --gold-soft: #e7d3a1;
  --bg: #eef1f5;
  --surface: #ffffff;
  --ink: #1a2233;
  --muted: #6b7684;
  --line: #e4e8ee;
  --danger: #c0392b;
  --success: #1e7d5a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 42, 91, .06), 0 6px 20px rgba(11, 42, 91, .07);
  --shadow-lg: 0 12px 40px rgba(11, 42, 91, .18);
  --maxw: 620px;
  --fs: 1;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Font-size scaling (accessibility). OB viewers default to "大". */
body.fs-base { --fs: 1; }
body.fs-lg { --fs: 1.18; }
body.fs-xl { --fs: 1.36; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }

/* iOS Home Screen apps sample the painted top edge for the system status bar.
   Keep a real, opaque surface above the sticky headers; gradients alone have
   a transparent background-color and can leave the iOS 27 blur over controls.
   The minimum also protects controls when an installed app reports zero inset. */
.statusbar-surface { display: none; }
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    :root { --safe-top: max(12px, env(safe-area-inset-top, 0px)); }
    html { background-color: var(--navy); }
    .statusbar-surface {
      display: block; position: fixed; inset: 0 0 auto; z-index: 25;
      height: var(--safe-top); background-color: var(--navy); pointer-events: none;
    }
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 18px;
  font-size: calc(15px * var(--fs)); font-weight: 600; line-height: 1;
  transition: transform .05s ease, background .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-soft); }
.btn--block { width: 100%; }
.btn--ghost { background: #eef1f6; color: var(--navy); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-ghost { background: #fbecea; color: var(--danger); }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 0;
  background: transparent; color: #fff;
}
.iconbtn svg { width: 22px; height: 22px; }
.detailbar .iconbtn { color: var(--navy); background: #eef1f6; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background:
    radial-gradient(120% 80% at 50% -10%, #17407e 0%, var(--navy) 45%, var(--navy-deep) 100%);
}
.login__card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: 22px; padding: 40px 28px 28px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.login__crest {
  width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy-soft), var(--navy));
  color: var(--gold-soft); font-weight: 800; font-size: calc(26px * var(--fs)); letter-spacing: 1px;
  box-shadow: inset 0 0 0 2px rgba(196,160,74,.5);
}
.login__title { margin: 0; font-size: calc(22px * var(--fs)); font-weight: 800; letter-spacing: .04em; }
.login__sub { margin: 4px 0 26px; color: var(--muted); font-size: calc(14px * var(--fs)); }
.login__form { text-align: left; }
.login__note { margin: 20px 0 0; font-size: calc(12px * var(--fs)); color: var(--muted); line-height: 1.7; }
.login__by { margin: 14px 0 0; font-size: calc(11px * var(--fs)); color: var(--muted); line-height: 1.6; opacity: .85; }
.login__by a { color: var(--navy); font-weight: 700; }
body[data-plan="free"] .login { min-height: calc(100vh - 46px - var(--safe-bottom)); }

.powered-by {
  flex: none; margin-top: auto; padding: 14px 16px calc(14px + var(--safe-bottom));
  color: var(--muted); text-align: center; font-size: calc(11.5px * var(--fs));
  letter-spacing: .03em;
}
.powered-by a { display: inline-block; opacity: .82; }
.powered-by a:hover { opacity: 1; }
.powered-by strong { color: var(--navy); font-size: 1.06em; letter-spacing: .01em; }

/* ---------- Fields ---------- */
.field { display: block; margin-bottom: 14px; }
.field__label { display: block; font-size: calc(12.5px * var(--fs)); font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field__label em { color: var(--danger); font-style: normal; font-size: calc(11px * var(--fs)); margin-left: 4px; }
.form__hint { margin: -8px 0 14px; font-size: calc(12px * var(--fs)); color: var(--muted); line-height: 1.6; }
.form__hint code { background: #eef1f6; border-radius: 5px; padding: 1px 5px; font-size: 0.92em; color: var(--navy); }
.input {
  width: 100%; padding: 12px 14px; font-size: calc(16px * var(--fs)); color: var(--ink);
  background: #f6f8fb; border: 1.5px solid var(--line); border-radius: 12px;
  transition: border .15s, background .15s;
}
.input:focus { outline: none; border-color: var(--navy-soft); background: #fff; }

/* password show/hide toggle */
.password-field { position: relative; }
.password-field .input { padding-right: 48px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; border-radius: 9px;
}
.password-toggle:hover { color: var(--navy); background: #eef1f6; }
.password-toggle svg { width: 20px; height: 20px; }
.password-field.is-checking .input { padding-right: 78px; }
.password-toggle.is-checking, .password-field.is-checking .password-toggle { width: auto; padding: 0 8px; color: var(--navy-soft); font-size: 11px; font-weight: 700; cursor: wait; }
.password-field.is-checking .password-toggle:hover { background: transparent; }
/* Suppress the browser's own in-field reveal / password-manager buttons —
   we already provide a custom eye toggle, and the native ones overlap it. */
.password-field .input::-ms-reveal,
.password-field .input::-ms-clear { display: none; }
.password-field .input::-webkit-contacts-auto-fill-button,
.password-field .input::-webkit-credentials-auto-fill-button {
  visibility: hidden; pointer-events: none; position: absolute; right: 0;
}
.input--area { resize: vertical; min-height: 52px; line-height: 1.6; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7684' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.check { display: flex; align-items: center; gap: 10px; font-size: calc(15px * var(--fs)); padding: 6px 0 2px; }
.addr-inputs { display: flex; flex-direction: column; gap: 8px; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background-color: var(--navy);
  background-image: linear-gradient(180deg, var(--navy) 0%, var(--navy) 62%, var(--navy-deep) 100%);
  color: #fff; padding: calc(var(--safe-top) + 12px) 16px 12px;
  box-shadow: 0 4px 16px rgba(7, 30, 66, .22);
}
.topbar__row { display: flex; align-items: center; justify-content: space-between; }
.topbar__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__actions { display: flex; align-items: center; gap: 2px; flex: none; }
.fontbtn { flex-direction: column; gap: 0; line-height: 1; }
.fontbtn span { font-size: calc(17px * var(--fs)); font-weight: 700; }
.fontbtn small { font-size: 9px; opacity: .75; margin-top: 1px; }
.topbar__crest {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: var(--gold-soft);
  font-weight: 800; font-size: calc(16px * var(--fs)); letter-spacing: .5px;
  box-shadow: inset 0 0 0 1.5px rgba(196,160,74,.5);
}
.topbar__title { font-size: calc(17px * var(--fs)); font-weight: 700; letter-spacing: .02em; }
.topbar__sub { font-size: calc(12px * var(--fs)); opacity: .7; }

.segment {
  display: flex; gap: 4px; margin-top: 14px; padding: 4px;
  background: rgba(255,255,255,.1); border-radius: 12px;
}
.segment__item {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 9px;
  font-size: calc(14px * var(--fs)); font-weight: 600; color: rgba(255,255,255,.82); transition: .2s;
}
.segment__item.is-active { background: #fff; color: var(--navy); box-shadow: 0 2px 6px rgba(0,0,0,.12); }

.searchbar { position: relative; margin-top: 12px; }
.searchbar__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.searchbar__icon svg { width: 18px; height: 18px; }
.searchbar__input {
  width: 100%; padding: 11px 14px 11px 40px; font-size: calc(15px * var(--fs));
  border: 0; border-radius: 11px; background: #fff; color: var(--ink);
}
.searchbar__input:focus { outline: 2px solid var(--gold); }

.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 13px; border-radius: 20px; border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08); color: #fff; font-size: calc(12.5px * var(--fs)); font-weight: 600; white-space: nowrap;
}
.chip.is-active { background: var(--gold); border-color: var(--gold); color: #3a2c06; }

/* year filter dropdown (OB) */
.year-filter { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.year-filter__label { flex: none; font-size: calc(12.5px * var(--fs)); font-weight: 700; color: var(--gold-soft); }
.year-filter__wrap { position: relative; flex: 1; max-width: 340px; }
.year-filter__wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 10px; height: 10px;
  transform: translateY(-60%) rotate(45deg); border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); pointer-events: none;
}
.year-filter__select {
  width: 100%; appearance: none; -webkit-appearance: none;
  background: #fff; color: var(--ink); border: 0; border-radius: 11px;
  padding: 11px 38px 11px 14px; font-size: calc(14.5px * var(--fs)); font-weight: 600;
}
.year-filter__select:focus { outline: 2px solid var(--gold); }

/* ---------- List ---------- */
.list { padding: 14px 14px calc(96px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; }
.group__head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: calc(13px * var(--fs)); font-weight: 700; color: var(--navy);
  margin: 14px 4px 2px; padding-bottom: 6px; border-bottom: 2px solid var(--gold-soft);
}
.group__head span { font-size: calc(11px * var(--fs)); color: var(--muted); font-weight: 600; }

.card {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: var(--shadow); transition: transform .06s, box-shadow .2s;
}
.card:active { transform: scale(.99); }
.card__avatar {
  width: 46px; height: 46px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #23508f, var(--navy)); color: #fff;
  font-size: calc(20px * var(--fs)); font-weight: 700;
}
.card__body { flex: 1; min-width: 0; }
.card__name { font-size: calc(16px * var(--fs)); font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card__blood { font-size: calc(10.5px * var(--fs)); font-weight: 700; color: var(--navy); background: #eaf0f9; border-radius: 6px; padding: 1px 6px; }
.card__sub { font-size: calc(12.5px * var(--fs)); color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.card__chev { color: #c3ccd7; font-size: calc(22px * var(--fs)); flex: none; }

.badge {
  font-size: calc(10.5px * var(--fs)); font-weight: 700; padding: 3px 8px; border-radius: 20px;
  background: #eef1f6; color: var(--navy-soft);
}
.badge--role { background: var(--navy); color: #fff; }
.badge--gold { background: #f6edd6; color: #7a5c14; }
.badge--plain { background: #eef1f6; color: var(--muted); }

/* ---------- FAB ---------- */
.fab {
  position: fixed; z-index: 30;
  right: max(18px, calc(50% - var(--maxw)/2 + 18px));
  bottom: calc(20px + var(--safe-bottom));
  width: 56px; height: 56px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: #3a2c06; box-shadow: 0 8px 24px rgba(150,116,30,.4);
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.95); }

/* ---------- Detail ---------- */
.detailbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px);
  padding: calc(var(--safe-top) + 8px) 12px 8px; border-bottom: 1px solid var(--line);
}
.detailbar__title { font-size: calc(16px * var(--fs)); font-weight: 700; }
.detail { padding: 0 14px calc(40px + var(--safe-bottom)); }
.profile { text-align: center; padding: 26px 0 20px; }
.profile__avatar {
  width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #23508f, var(--navy)); color: #fff;
  font-size: calc(38px * var(--fs)); font-weight: 700; box-shadow: var(--shadow);
}
.profile__name { margin: 0; font-size: calc(24px * var(--fs)); font-weight: 800; letter-spacing: .02em; }
.profile__badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.profile__stat { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 12px; color: var(--muted); font-size: calc(12.5px * var(--fs)); }
.profile__stat span { position: relative; }

.detail__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.detail__row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.detail__row:last-child { border-bottom: 0; }
.detail__label { font-size: calc(12.5px * var(--fs)); color: var(--muted); font-weight: 600; padding-top: 1px; }
.detail__value { font-size: calc(14.5px * var(--fs)); word-break: break-word; }
.detail__value--multiline { white-space: pre-wrap; }
.detail__link { display: inline-flex; align-items: center; gap: 7px; color: var(--navy-soft); font-weight: 600; }
.detail__link svg { width: 16px; height: 16px; flex: none; color: var(--gold); }
.detail__link--addr { align-items: flex-start; }
.detail__link--addr svg { margin-top: 3px; }
.addr { display: inline-flex; flex-direction: column; line-height: 1.5; }
.addr__zip { font-size: calc(12.5px * var(--fs)); color: var(--muted); font-weight: 600; }
.detail__actions { display: flex; gap: 10px; margin-top: 18px; }
.detail__actions .btn { flex: 1; }

/* ---------- Form ---------- */
.form-wrap { padding: 14px 14px calc(40px + var(--safe-bottom)); }
.form__group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px 4px; margin-bottom: 14px; box-shadow: var(--shadow); }
.form__group-title { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--gold); letter-spacing: .08em; margin-bottom: 10px; }
.form__actions { margin-top: 6px; }

/* ---------- Utilities ---------- */
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: calc(14px * var(--fs)); }
.loading { display: flex; justify-content: center; padding: 70px 0; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translateX(-50%);
  z-index: 100; max-width: 88%; padding: 12px 20px; border-radius: 12px;
  background: #2b3444; color: #fff; font-size: calc(14px * var(--fs)); font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toastIn .2s ease;
}
.toast--error { background: var(--danger); }
.toast--success { background: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10,20,40,.5); backdrop-filter: blur(2px); }
.modal__card { width: 100%; max-width: 340px; background: #fff; border-radius: 18px; padding: 24px 22px 18px; box-shadow: var(--shadow-lg); }
.modal__msg { margin: 0 0 20px; font-size: calc(15px * var(--fs)); line-height: 1.6; text-align: center; }
.modal__actions { display: flex; gap: 10px; }
.modal__actions .btn { flex: 1; }

/* ---------- Drawer (hamburger menu) ---------- */
.topbar__brand .iconbtn { color: #fff; margin-left: -6px; flex: none; }
.drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer__scrim {
  position: absolute; inset: 0; background: rgba(8, 20, 40, .5);
  opacity: 0; transition: opacity .25s;
}
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: 84%; max-width: 320px;
  background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
  padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
}
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; gap: 12px; padding: 18px 16px;
  background: linear-gradient(180deg, var(--navy), var(--navy-deep)); color: #fff;
}
.drawer__crest {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: var(--gold-soft); font-weight: 800;
  box-shadow: inset 0 0 0 1.5px rgba(196,160,74,.5);
}
.brand-logo { overflow: hidden; }
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-logo.has-image {
  padding: 4px; background: #fff; color: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(11,42,91,.13), 0 2px 8px rgba(7,30,66,.12);
}
.drawer__title { font-size: calc(15px * var(--fs)); font-weight: 700; }
.drawer__sub { font-size: calc(11.5px * var(--fs)); opacity: .7; }
.drawer__close { margin-left: auto; color: #fff; }
.drawer__list { flex: 1; overflow-y: auto; padding: 8px; }
.drawer__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px; border-radius: 12px; color: var(--ink);
  font-size: calc(15px * var(--fs)); font-weight: 600;
}
.drawer__item:hover { background: #f2f5f9; }
.drawer__item.is-active { background: var(--navy); color: #fff; }
.drawer__chev { color: #c3ccd7; font-size: calc(20px * var(--fs)); }
.drawer__item.is-active .drawer__chev { color: rgba(255,255,255,.6); }

/* ---------- Content pages ---------- */
.content-page { padding: 16px 16px calc(40px + var(--safe-bottom)); }
.doc { max-width: 680px; margin: 0 auto; }
.doc h3 {
  font-size: calc(15px * var(--fs)); font-weight: 800; color: var(--navy);
  margin: 22px 0 10px; padding-bottom: 7px; border-bottom: 2px solid var(--gold-soft);
}
.doc h3:first-child { margin-top: 4px; }
.doc p { font-size: calc(14px * var(--fs)); line-height: 1.85; color: #2a3342; margin: 0 0 12px; }
ruby { ruby-position: over; }
rt { font-size: 0.68em; color: var(--muted); font-weight: 400; line-height: 1; }
.doc p:has(ruby), .creed:has(ruby), .rte__area p:has(ruby) { line-height: 2.5; }
.doc__lead { font-size: calc(13px * var(--fs)); color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.doc__note { font-size: calc(12.5px * var(--fs)); color: var(--muted); }
.doc__points { margin: 6px 0 14px; padding-left: 0; list-style: none; }
.doc__points li {
  position: relative; padding: 7px 0 7px 20px; font-size: calc(14px * var(--fs));
  line-height: 1.6; border-bottom: 1px solid var(--line);
}
.doc__points li::before { content: ''; position: absolute; left: 4px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.slogan {
  text-align: center; background: linear-gradient(160deg, #17407e, var(--navy));
  color: #fff; border-radius: var(--radius); padding: 26px 18px; margin-bottom: 8px;
}
.slogan__label { font-size: calc(12px * var(--fs)); letter-spacing: .1em; color: var(--gold-soft); }
.slogan__main { font-size: calc(30px * var(--fs)); font-weight: 800; margin: 8px 0 6px; letter-spacing: .06em; }
.slogan__sub { font-size: calc(12.5px * var(--fs)); opacity: .85; }

.officer {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.officer__role { font-size: calc(11px * var(--fs)); font-weight: 700; color: var(--gold); letter-spacing: .04em; }
.officer__name { font-size: calc(17px * var(--fs)); font-weight: 700; margin: 2px 0; }
.officer__org { font-size: calc(12.5px * var(--fs)); color: var(--muted); }
.officer__tel { display: inline-block; margin-top: 5px; font-size: calc(13px * var(--fs)); color: var(--navy-soft); font-weight: 600; }

.info-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.info-table th, .info-table td { text-align: left; padding: 11px 13px; font-size: calc(13.5px * var(--fs)); border-bottom: 1px solid var(--line); vertical-align: top; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 0; }
.info-table th { font-weight: 700; color: var(--navy); white-space: nowrap; background: #f6f8fb; }
.info-table--history th { width: 3.5em; white-space: nowrap; }
.info-table--history td:first-of-type { color: var(--muted); white-space: nowrap; width: 5.5em; }

.plan-group { margin-bottom: 12px; }
.plan-group__label { display: inline-block; font-size: calc(12px * var(--fs)); font-weight: 700; color: #fff; background: var(--navy-soft); border-radius: 6px; padding: 3px 10px; margin-bottom: 2px; }

.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.name-grid span { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: calc(13.5px * var(--fs)); text-align: center; }

.creed { text-align: center; font-size: calc(15px * var(--fs)); line-height: 2.1; color: var(--navy-deep); font-weight: 500; }
.creed--song { white-space: pre-wrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 14px; }
.table-wrap .info-table { margin-bottom: 0; }
.doc__toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.doc__editbtns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.doc__editbtns .btn { flex: 1; min-width: 120px; }
/* WYSIWYG editor */
.rte { border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.rte__toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px; background: #f6f8fb; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.rte__btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 11px; font-size: calc(12.5px * var(--fs)); font-weight: 600; color: var(--ink); white-space: nowrap; transition: background .15s, color .15s; }
.rte__btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.rte__btn:active { transform: scale(.96); }
.rte__area { padding: 16px 18px; min-height: 340px; outline: none; }
.rte__area:focus { box-shadow: inset 0 0 0 2px rgba(196,160,74,.4); border-radius: 0 0 12px 12px; }
.rte__area h3:first-child { margin-top: 4px; }

/* content management hub */
.admin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.admin-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.admin-item:hover { border-color: var(--navy-soft); }
.admin-item__title { font-size: calc(15px * var(--fs)); font-weight: 700; }
.admin-item__sub { font-size: calc(12px * var(--fs)); color: var(--muted); margin-top: 2px; }
.admin-item__chev { color: #c3ccd7; font-size: calc(20px * var(--fs)); }
/* Content-page management rows (title + inline operations) */
.admin-item--page { gap: 10px; flex-wrap: wrap; }
.admin-item__body { display: block; flex: 1 1 180px; min-width: 0; text-decoration: none; color: inherit; }
.admin-ops { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-op {
  border: 1px solid var(--line); background: #f6f8fb; color: var(--ink);
  border-radius: 8px; padding: 6px 10px; font-size: calc(12.5px * var(--fs)); cursor: pointer; line-height: 1;
}
.admin-op:hover:not(:disabled) { border-color: var(--navy-soft); background: #eef1f6; }
.admin-op:disabled { opacity: .4; cursor: default; }
.admin-op--danger { color: var(--danger); }
.admin-add { margin-top: 14px; }
/* member-card customisation rows (名簿項目の設定) */
.fieldcfg { display: flex; flex-direction: column; gap: 8px; }
.fieldcfg__row { display: flex; align-items: center; gap: 12px; }
.fieldcfg__check { flex: 0 0 46%; min-width: 0; padding: 2px 0; }
.fieldcfg__check span { font-size: calc(14px * var(--fs)); font-weight: 600; }
.fieldcfg__label { flex: 1; padding: 8px 12px; font-size: calc(14px * var(--fs)); }
.fieldcfg__type { flex: 0 0 96px; padding: 8px 10px; font-size: calc(13px * var(--fs)); }

@media (max-width: 520px) { .fieldcfg__check { flex-basis: 52%; } }
.drawer__item--admin { color: var(--gold); border-top: 1px solid var(--line); margin-top: 6px; }
.drawer__item--admin.is-active { color: #fff; }

/* ---------- Contract file transfer ---------- */
.file-page { width: min(1180px, 100%); margin: 0 auto; padding: 18px 16px calc(54px + var(--safe-bottom)); }
.file-studio {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 0;
  overflow: hidden; color: #fff; background: var(--navy); border: 1px solid #173c70;
  border-radius: 26px; box-shadow: 0 24px 56px rgba(11, 42, 91, .16);
}
.file-studio__intro { padding: 36px 38px 30px; }
.file-hero__eyebrow { display: block; margin-bottom: 10px; color: var(--gold-soft); font-size: 10.5px; font-weight: 800; letter-spacing: .17em; }
.file-studio h1 { margin: 0; max-width: 520px; font-size: clamp(calc(28px * var(--fs)), 4.2vw, calc(48px * var(--fs))); line-height: 1.12; letter-spacing: -.035em; }
.file-studio__intro p { max-width: 610px; margin: 17px 0 0; color: #cbd7e8; font-size: calc(13px * var(--fs)); line-height: 1.85; }
.file-studio__benefits { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.file-studio__benefits span { padding: 5px 10px; border: 1px solid #45658e; border-radius: 999px; color: #dce5f1; font-size: calc(10.5px * var(--fs)); font-weight: 700; }
.file-retention { display: flex; flex-direction: column; justify-content: center; padding: 30px; background: #102f5c; border-left: 1px solid #274876; }
.file-retention label { margin-bottom: 9px; color: #d7e0ed; font-size: calc(12px * var(--fs)); font-weight: 700; }
.file-retention select { width: 100%; min-height: 48px; border: 1px solid #6f82a0; border-radius: 12px; padding: 0 38px 0 14px; background: #fff; color: var(--ink); font: inherit; font-weight: 800; }
.file-retention p { margin: 10px 0 0; color: #aebcd0; font-size: calc(11px * var(--fs)); line-height: 1.65; }
.file-drop {
  grid-column: 1 / -1; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 18px;
  min-height: 126px; margin: 0 16px 16px; padding: 22px 26px; cursor: pointer;
  border: 1.5px dashed #6f86a8; border-radius: 18px; background: #f9fbfe; color: var(--ink);
  transition: transform .28s cubic-bezier(.16,1,.3,1), border-color .28s ease, background .28s ease;
}
.file-drop:hover, .file-drop.is-dragging { transform: translateY(-2px); border-color: var(--gold); background: #fffdf7; }
.file-drop.is-uploading { pointer-events: none; opacity: .68; }
.file-drop__icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; background: #e9eef6; color: var(--navy); }
.file-drop__icon svg { width: 29px; height: 29px; }
.file-drop__copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.file-drop__copy b { font-size: calc(16px * var(--fs)); }
.file-drop__copy small { color: var(--muted); font-size: calc(12px * var(--fs)); }
.file-drop__action { min-width: 122px; padding: 12px 16px; border-radius: 11px; background: var(--gold); color: #2e230d; text-align: center; font-size: calc(12px * var(--fs)); font-weight: 800; }
.file-usage, .upload-status, .share-results, .file-section { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 10px 30px rgba(11, 42, 91, .055); }
.file-logout { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid rgba(255,255,255,.34); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: calc(12px * var(--fs)); font-weight: 700; cursor: pointer; }
.file-logout:hover { background: rgba(255,255,255,.16); }
.file-logout svg { width: 18px; height: 18px; }
.file-usage > div:first-child { display: flex; justify-content: space-between; gap: 14px; font-size: calc(13px * var(--fs)); }
.file-usage > div:first-child span { color: var(--muted); font-variant-numeric: tabular-nums; }
.file-usage__track, .upload-progress { height: 7px; margin-top: 12px; overflow: hidden; background: #e8edf4; border-radius: 99px; }
.file-usage__track span, .upload-progress i { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: var(--gold); border-radius: inherit; transition: transform .25s cubic-bezier(.16,1,.3,1); }
.file-usage__detail { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: #637084; font-size: calc(11.5px * var(--fs)); line-height: 1.65; }
.file-usage__detail.is-error { color: var(--danger); }
.upload-status__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.upload-status__head span { color: var(--muted); font-size: calc(12px * var(--fs)); }
.upload-queue { display: grid; gap: 0; }
.upload-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 15px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.upload-item:last-child { border-bottom: 0; padding-bottom: 0; }
.upload-item > div:first-child { display: flex; min-width: 0; flex-direction: column; }
.upload-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(13px * var(--fs)); }
.upload-item span { color: var(--muted); font-size: calc(11px * var(--fs)); }
.upload-item strong { color: var(--muted); font-size: calc(12px * var(--fs)); font-variant-numeric: tabular-nums; }
.upload-item.is-processing strong { display: inline-flex; align-items: center; gap: 7px; color: #765a1f; }
.upload-item.is-processing strong::before { content: ''; width: 12px; height: 12px; flex: none; border: 2px solid rgba(118,90,31,.24); border-top-color: #765a1f; border-radius: 50%; animation: upload-processing-spin .8s linear infinite; }
.upload-item.is-processing .upload-progress i { animation: upload-processing-pulse 1.25s ease-in-out infinite; }
@keyframes upload-processing-spin { to { transform: rotate(360deg); } }
@keyframes upload-processing-pulse { 50% { opacity: .42; } }
.upload-item.is-complete strong { color: #397052; }
.upload-item.is-error strong { color: var(--danger); }
.upload-item .upload-progress { grid-column: 1 / -1; margin-top: 2px; }
.share-results { border-color: #d8c18b; background: #fffdf8; }
.share-results__head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.share-results__head > span { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: #f3ead5; color: #765a1f; }
.share-results__head svg { width: 21px; height: 21px; }
.share-results__head b { font-size: calc(15px * var(--fs)); }
.share-results__head p { margin: 4px 0 0; color: var(--muted); font-size: calc(12px * var(--fs)); line-height: 1.6; }
.share-results__list { display: grid; gap: 12px; }
.share-result { padding-top: 12px; border-top: 1px solid #eadfca; }
.share-result__meta { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.share-result__meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(12.5px * var(--fs)); }
.share-result__meta span { flex: none; color: var(--muted); font-size: calc(11px * var(--fs)); }
.share-result__url { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.share-result__url input { min-width: 0; min-height: 42px; border: 1px solid #d9c99f; border-radius: 10px; padding: 0 12px; background: #fff; color: #4f5665; font-size: calc(12px * var(--fs)); }
.file-section { padding-top: 18px; }
.file-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.file-section__head span { color: #8b6a22; font-size: 9.5px; font-weight: 800; letter-spacing: .15em; }
.file-section__head h2 { margin: 3px 0 0; font-size: calc(19px * var(--fs)); }
.file-btn { padding: 8px 11px; font-size: calc(12px * var(--fs)); }
.file-row { display: grid; grid-template-columns: 42px minmax(130px,1fr) minmax(145px,.45fr) auto; align-items: center; gap: 13px; padding: 15px 0; border-top: 1px solid var(--line); animation: file-row-in .42s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--file-index) * 50ms); }
@keyframes file-row-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.file-row__icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #edf1f7; color: var(--navy); }
.file-row__icon svg { width: 20px; height: 20px; }
.file-row__body { min-width: 0; display: flex; flex-direction: column; }
.file-row__body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(13.5px * var(--fs)); }
.file-row__body span { color: var(--muted); font-size: calc(11.5px * var(--fs)); }
.file-row__expiry { display: flex; min-width: 0; flex-direction: column; }
.file-row__expiry span { color: #765a1f; font-size: calc(12px * var(--fs)); font-weight: 800; }
.file-row__expiry small { overflow: hidden; color: var(--muted); font-size: calc(10.5px * var(--fs)); text-overflow: ellipsis; white-space: nowrap; }
.file-row__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.file-trash { border-color: #dfd8c9; background: #fffefa; }
.file-trash__badge { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border: 1px solid #ddd0ae; border-radius: 99px; background: #fbf5e8; color: #765a1f; font-size: calc(10.5px * var(--fs)); font-weight: 800; white-space: nowrap; }
.file-trash__note { margin: 3px 0 0; color: var(--muted); font-size: calc(11.5px * var(--fs)); line-height: 1.65; }
.file-trash-row { display: grid; grid-template-columns: 42px minmax(130px,1fr) minmax(145px,.45fr) auto; align-items: center; gap: 13px; padding: 15px 0; border-top: 1px solid #ebe4d6; animation: file-row-in .42s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--file-index) * 50ms); }
.file-trash-row__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #f3ead8; color: #765a1f; }
.file-trash-row__icon svg { width: 20px; height: 20px; }
.file-trash-row .file-row__expiry span { color: #765a1f; }
.file-trash-empty { display: flex; align-items: center; gap: 12px; padding: 24px 0 7px; border-top: 1px solid #ebe4d6; }
.file-trash-empty > span { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: #f3ead8; color: #765a1f; }
.file-trash-empty svg { width: 19px; height: 19px; }
.file-trash-empty b { display: block; font-size: calc(13px * var(--fs)); }
.file-trash-empty p { margin: 3px 0 0; color: var(--muted); font-size: calc(11px * var(--fs)); line-height: 1.55; }
.file-empty { display: flex; align-items: center; flex-direction: column; padding: 54px 20px 44px; text-align: center; }
.file-empty > span { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 13px; border-radius: 15px; background: #edf1f7; color: var(--navy); }
.file-empty svg { width: 24px; height: 24px; }
.file-empty b { font-size: calc(14px * var(--fs)); }
.file-empty p { margin: 6px 0 0; color: var(--muted); font-size: calc(12px * var(--fs)); line-height: 1.65; }
.file-skeleton { display: grid; gap: 10px; padding-top: 14px; }
.file-skeleton i { display: block; height: 54px; border-radius: 12px; background: linear-gradient(90deg,#eef1f5 25%,#f8f9fb 45%,#eef1f5 65%); background-size: 220% 100%; animation: file-shimmer 1.25s ease infinite; }
@keyframes file-shimmer { to { background-position: -220% 0; } }
.file-inline-error { margin: 18px 0 0; padding: 16px; border: 1px solid #edc6c1; border-radius: 12px; background: #fff7f6; color: var(--danger); font-size: calc(13px * var(--fs)); }
@media (prefers-reduced-motion: reduce) { .file-row, .file-trash-row, .file-skeleton i, .upload-item.is-processing strong::before, .upload-item.is-processing .upload-progress i { animation: none; } .file-drop { transition: none; } }
@media (max-width: 760px) {
  .file-logout { min-height: 36px; padding: 0 10px; }
  .file-logout span { display: none; }
  .file-studio { grid-template-columns: 1fr; border-radius: 20px; }
  .file-studio__intro { padding: 28px 22px 23px; }
  .file-studio h1 { font-size: calc(30px * var(--fs)); }
  .file-retention { padding: 20px 22px; border-top: 1px solid #274876; border-left: 0; }
  .file-drop { grid-template-columns: 50px minmax(0,1fr); margin: 14px; padding: 18px; }
  .file-drop__icon { width: 50px; height: 50px; border-radius: 14px; }
  .file-drop__action { grid-column: 1 / -1; }
  .file-row, .file-trash-row { grid-template-columns: 42px minmax(0,1fr); align-items: start; }
  .file-row__expiry { grid-column: 2; }
  .file-row__actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 3px; }
  .share-result__meta { align-items: flex-start; flex-direction: column; gap: 3px; }
}
@media (max-width: 480px) {
  .file-page { padding-inline: 12px; }
  .file-studio__intro p { font-size: calc(12px * var(--fs)); }
  .file-studio__benefits { gap: 6px; }
  .file-drop { grid-template-columns: 1fr; text-align: center; }
  .file-drop__icon { margin: 0 auto; }
  .share-result__url { grid-template-columns: 1fr; }
  .share-result__url .btn { width: 100%; justify-content: center; }
}

@media (min-width: 860px) {
  .content-page { padding: 24px 28px 48px; }
  .file-page { padding: 24px 28px 56px; }
}

/* ---------- Photo avatars ---------- */
.card__avatar, .profile__avatar { overflow: hidden; }
.card__avatar img, .profile__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-edit { display: flex; align-items: center; gap: 16px; padding-bottom: 10px; }
.photo-edit__preview {
  width: 88px; height: 88px; flex: none; border-radius: 24px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #23508f, var(--navy));
  color: #fff; font-size: calc(38px * var(--fs)); font-weight: 700;
}
.photo-edit__preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-edit__actions { display: flex; flex-direction: column; gap: 8px; }
.photo-edit__pick { cursor: pointer; margin: 0; }

/* ---------- Superadmin (org management) ---------- */
.super__bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; padding: calc(var(--safe-top) + 14px) 18px 14px; font-weight: 700; font-size: calc(15px * var(--fs)); }
.super__actions { padding: 16px; }
.super__actions--orgs { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.super__platform-storage {
	display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 2px 10px;
	margin-left: auto; padding: 3px 0 3px 18px; border-left: 1px solid var(--line); text-align: right;
}
.super__platform-storage span { color: var(--muted); font-size: calc(11.5px * var(--fs)); font-weight: 700; }
.super__platform-storage strong { color: var(--ink); font-size: calc(15px * var(--fs)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.super__platform-storage.is-loading strong { animation: platformStorageLoading 1.4s ease-in-out infinite; }
.super__platform-storage.is-warning strong { color: var(--danger); }
.super__platform-storage.is-unavailable strong { color: var(--muted); }
@keyframes platformStorageLoading { 0%, 100% { opacity: .35; } 50% { opacity: .8; } }
.super__list { padding: 0 16px calc(40px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; }
.super__org { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.super__org-main { flex: 1; min-width: 280px; }
.super__org-name { font-size: calc(16px * var(--fs)); font-weight: 700; }
.super__slug { font-size: calc(11.5px * var(--fs)); color: #fff; background: var(--navy-soft); border-radius: 6px; padding: 1px 8px; margin-left: 6px; font-weight: 600; }
.super__plan-free { background: var(--gold); color: #22160a; }
.super__org-sub { font-size: calc(12px * var(--fs)); color: var(--muted); margin-top: 3px; }
.super__org-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.super__org-btns .btn { padding: 9px 13px; font-size: calc(13px * var(--fs)); }
.super__storage {
  display: grid; grid-template-columns: auto auto minmax(100px, 180px) minmax(150px, 1fr);
  align-items: center; gap: 6px 10px; max-width: 720px; margin-top: 8px;
  color: var(--muted); font-size: calc(11.5px * var(--fs));
}
.super__storage-label { font-weight: 700; color: var(--muted); }
.super__storage strong { color: var(--ink); font-size: calc(12.5px * var(--fs)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.super__storage small { color: var(--muted); font-size: calc(11px * var(--fs)); white-space: nowrap; }
.super__storage-track { height: 5px; overflow: hidden; border-radius: 99px; background: #e7ebf1; }
.super__storage-track i {
  display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--navy-soft);
  transform: scaleX(0); transform-origin: left center; transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.super__storage.is-loading .super__storage-track i { animation: storageLoading 1.4s ease-in-out infinite; }
.super__storage.is-warning strong { color: var(--danger); }
.super__storage.is-warning .super__storage-track i { background: var(--danger); }
.super__storage.is-unavailable .super__storage-track { opacity: .45; }
@keyframes storageLoading {
  0% { transform: scaleX(.08); opacity: .35; }
  50% { transform: scaleX(.58); opacity: .75; }
  100% { transform: scaleX(.08); opacity: .35; }
}
.super__form { max-width: 760px; margin: 0 auto; }
.super__password-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.super__password-generate { min-width: 104px; padding-inline: 16px; white-space: nowrap; }
.recovery__warning { padding: 12px 14px; border-left: 3px solid var(--gold); background: #fffaf0; color: var(--ink); }
.recovery__scope { margin: 4px 0 14px; padding: 11px 13px; border-radius: 8px; background: var(--soft); color: var(--ink); font-size: calc(13px * var(--fs)); font-weight: 600; }
.recovery__history-title { margin-top: 28px; }
.recovery__history { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.recovery__history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.recovery__history-item strong { font-size: calc(13px * var(--fs)); }
.recovery__history-item span, .recovery__history-item small { color: var(--muted); font-size: calc(11.5px * var(--fs)); }
.recovery__history-item small { grid-column: 1 / -1; }
.recovery__history-item .btn { grid-row: 1 / span 2; grid-column: 2; padding: 7px 10px; font-size: calc(12px * var(--fs)); }
.brand-editor { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; margin-top: 6px; }
.brand-editor__section { min-width: 0; }
.brand-editor__label { display: block; margin-bottom: 9px; color: var(--muted); font-size: calc(12.5px * var(--fs)); font-weight: 700; }
.color-control { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
.color-control__picker {
  width: 58px; height: 48px; padding: 4px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #f6f8fb; cursor: pointer;
}
.color-control__picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-control__picker::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-palette { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.color-swatch {
  width: 34px; height: 34px; padding: 0; border: 3px solid #fff; border-radius: 50%;
  background: var(--swatch); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer;
}
.color-swatch:hover { transform: translateY(-1px); }
.color-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink), 0 4px 10px rgba(15,23,42,.16); }
.brand-field-error { min-height: 18px; margin: 7px 0 0; color: var(--danger); font-size: calc(12px * var(--fs)); line-height: 1.5; }
.logo-editor { display: flex; align-items: center; gap: 14px; }
.logo-editor__preview {
  width: 88px; height: 88px; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--line); border-radius: 20px; overflow: hidden; background: #f6f8fb;
  color: var(--muted); font-size: calc(11px * var(--fs)); font-weight: 700;
}
.logo-editor__preview.has-image { border-style: solid; background: #fff; padding: 7px; }
.logo-editor__preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-editor__actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.logo-editor__actions .btn { white-space: nowrap; }
.logo-editor__help { margin: 10px 0 0; color: var(--muted); font-size: calc(11.5px * var(--fs)); line-height: 1.6; }

@media (max-width: 639px) {
	.super__actions--orgs { align-items: stretch; flex-wrap: wrap; }
	.super__platform-storage { width: 100%; margin-left: 0; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
	.brand-editor { grid-template-columns: 1fr; gap: 18px; }
  .super__org-main { flex: 0 0 100%; width: 100%; min-width: 0; }
  .super__org-btns { width: 100%; }
  .super__storage { grid-template-columns: auto 1fr; }
  .super__storage-track, .super__storage small { grid-column: 1 / -1; }
  .super__storage small { white-space: normal; }
}

@media (min-width: 640px) {
  #app { box-shadow: 0 0 60px rgba(11,42,91,.08); }
}

/* ==================== Desktop layout (wide screens) ==================== */
@media (min-width: 860px) {
  /* Use the full browser width on PC (no centred column cap) */
  #app { max-width: none; min-height: 100vh; }

  /* Header: brand + controls laid out across the full width */
  .topbar { padding: 18px 28px 16px; }
  .topbar__title { font-size: calc(19px * var(--fs)); }
  .topbar__controls {
    display: flex; align-items: center; gap: 16px; margin-top: 16px;
  }
  .topbar__controls .segment { flex: 0 0 300px; margin-top: 0; }
  .topbar__controls .searchbar { flex: 1; margin-top: 0; max-width: 560px; }
  .chips { margin-top: 14px; }

  /* Member list becomes a responsive card grid */
  .list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px; align-content: start; padding: 20px 28px 40px;
  }
  .group__head { grid-column: 1 / -1; margin-top: 18px; }
  .empty { grid-column: 1 / -1; }

  /* Subtle hover affordance on pointer devices */
  .card:hover { box-shadow: 0 6px 24px rgba(11,42,91,.13); transform: translateY(-2px); }
  .segment__item, .chip, .btn, .iconbtn { transition: all .18s ease; }

  /* Other screens also use the full width */
  .detailbar { max-width: none; padding: 12px 28px; }

  /* Content pages: structural blocks fill the width, prose stays readable */
  .content-page { padding: 20px 28px 48px; }
  .doc { max-width: none; }
  .doc > p, .doc > .doc__lead, .doc > .doc__note { max-width: 980px; }
  .doc > p.creed { max-width: 720px; margin-left: auto; margin-right: auto; }
  .officer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }

  /* Member detail: photo/profile beside the info card */
  .detail {
    max-width: none; display: grid; grid-template-columns: 320px 1fr;
    gap: 28px; align-items: start; padding: 20px 28px 48px;
  }
  .profile { grid-column: 1; grid-row: 1 / 3; padding-top: 8px; position: sticky; top: 80px; }
  .profile__avatar { width: 120px; height: 120px; border-radius: 32px; }
  .detail__card { grid-column: 2; grid-row: 1; }
  .detail__actions { grid-column: 2; grid-row: 2; max-width: 440px; }

  /* Member form: field groups in two columns */
  .form-wrap { max-width: none; padding: 20px 28px 48px; }
  .form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .form__group { margin-bottom: 0; }
  .form__group--photo, .form__actions { grid-column: 1 / -1; }

  /* Floating add button pinned to the bottom-right of the viewport */
  .fab { width: 60px; height: 60px; right: 28px; }
}
