/* Page-specific CSS for mode-atlas-wordbank-page.css. Shared repeated rules moved to mode-atlas-page-shared.css. */

:root {
  --ma-font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ma-font-display: Sora, Inter, ui-sans-serif, system-ui, sans-serif;
  --ma-font-jp: "Noto Sans JP", Inter, ui-sans-serif, system-ui, sans-serif;
}

:root {
      --bg: #0f172a;
      --panel: #111827;
      --panel-2: #1f2937;
      --card: #0b1220;
      --border: #334155;
      --text: #e5e7eb;
      --muted: #94a3b8;
      --accent: #22c55e;
      --accent-2: #16a34a;
      --blue: #3b82f6;
      --amber: #f59e0b;
      --red: #ef4444;
      --shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    }

body {
      margin: 0;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background:
        radial-gradient(circle at 12% 12%, rgba(255,159,202,0.13), transparent 24%),
        radial-gradient(circle at 84% 8%, rgba(132,187,255,0.12), transparent 22%),
        radial-gradient(circle at 50% 100%, rgba(246,211,138,0.08), transparent 30%),
        linear-gradient(180deg, #151923 0%, #070a11 100%);
      color: var(--text);
      min-height: 100vh;
    }

.wrap {
      width: min(1180px, calc(100% - 32px));
      margin: 20px auto 56px;
    }

.hero {
      background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(59, 130, 246, 0.12));
      border: 1px solid rgba(148, 163, 184, 0.18);
      border-radius: 24px;
      padding: 24px;
      box-shadow: var(--shadow);
      margin-bottom: 20px;
    }

.topline {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
    }

h1 {
      margin: 0;
      font-size: clamp(2rem, 4vw, 2.7rem);
      line-height: 1.05;
      letter-spacing: -0.03em;
    }

.subtitle {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 0.98rem;
      max-width: 720px;
    }

.pill-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 18px;
    }

.pill {
      background: rgba(15, 23, 42, 0.72);
      color: var(--text);
      border: 1px solid rgba(148, 163, 184, 0.18);
      border-radius: 999px;
      padding: 8px 12px;
      font-size: 0.92rem;
    }

.stats {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 18px;
    }

.stat {
      background: rgba(15, 23, 42, 0.72);
      border: 1px solid rgba(148, 163, 184, 0.14);
      border-radius: 18px;
      padding: 16px;
    }

.stat .label {
      color: var(--muted);
      font-size: 0.85rem;
      margin-bottom: 6px;
    }

.stat .value {
      font-size: 1.6rem;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

.grid {
      display: grid;
      grid-template-columns: 360px minmax(0, 1fr);
      gap: 18px;
      align-items: start;
    }

.panel {
      background: rgba(17, 24, 39, 0.9);
      border: 1px solid rgba(148, 163, 184, 0.16);
      border-radius: 24px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

.panel-inner { padding: 20px; }

.panel h2 {
      margin: 0 0 6px;
      font-size: 1.2rem;
      letter-spacing: -0.02em;
    }

.panel p {
      margin: 0;
      color: var(--muted);
      line-height: 1.45;
      font-size: 0.96rem;
    }

label {
      display: block;
      font-size: 0.9rem;
      font-weight: 700;
      margin: 14px 0 8px;
    }

input[type="text"], textarea, select {
      width: 100%;
      background: #0f172a;
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 12px 14px;
      font: inherit;
      outline: none;
      transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    }

input[type="text"]:focus, textarea:focus, select:focus {
      border-color: rgba(34, 197, 94, 0.85);
      box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
    }

textarea {
      min-height: 90px;
      resize: vertical;
      line-height: 1.45;
    }

.hint {
      margin-top: 8px;
      color: var(--muted);
      font-size: 0.86rem;
    }

.btn-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 16px;
    }

button, .button-like {
      border: none;
      border-radius: 14px;
      padding: 11px 14px;
      font: inherit;
      font-weight: 800;
      cursor: pointer;
      transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
    }

button:hover, .button-like:hover { transform: translateY(-1px); }

button:active, .button-like:active { transform: translateY(0); }

.btn-primary {
      background: linear-gradient(180deg, var(--accent), var(--accent-2));
      color: white;
    }

.btn-secondary {
      background: #1e293b;
      color: var(--text);
      border: 1px solid var(--border);
    }

.btn-blue {
      background: var(--blue);
      color: white;
    }

.btn-amber {
      background: var(--amber);
      color: #111827;
    }

.btn-danger {
      background: rgba(239, 68, 68, 0.16);
      color: #fecaca;
      border: 1px solid rgba(239, 68, 68, 0.24);
    }

.toolbar {
      display: grid;
      grid-template-columns: 1.5fr 0.85fr 0.85fr;
      gap: 12px;
      margin-top: 18px;
    }

.toolbar .field label { margin-top: 0; }

.entries {
      margin-top: 16px;
      display: grid;
      gap: 14px;
    }

.empty {
      border: 1px dashed rgba(148, 163, 184, 0.22);
      border-radius: 18px;
      padding: 28px 18px;
      text-align: center;
      color: var(--muted);
      background: rgba(15, 23, 42, 0.34);
    }

.card {
      background: rgba(11, 18, 32, 0.92);
      border: 1px solid rgba(148, 163, 184, 0.14);
      border-radius: 20px;
      overflow: hidden;
    }

.card-summary {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto auto;
      gap: 12px;
      align-items: center;
      padding: 16px;
      cursor: pointer;
      list-style: none;
    }

.card-summary::-webkit-details-marker { display: none; }

.card-summary:hover {
      background: rgba(30, 41, 59, 0.2);
    }

.card-summary-main {
      min-width: 0;
    }

.card-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 12px;
    }

.kana {
      font-size: 1.65rem;
      font-weight: 900;
      letter-spacing: -0.03em;
      word-break: break-word;
    }

.romaji {
      margin-top: 6px;
      color: #bfdbfe;
      font-weight: 700;
      font-size: 0.98rem;
      word-break: break-word;
    }

.meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

.summary-col {
      min-width: 0;
    }

.summary-label {
      font-size: 0.74rem;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 4px;
    }

.summary-value {
      font-size: 0.95rem;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

.summary-date {
      text-align: right;
    }

.summary-toggle {
      font-size: 1rem;
      color: var(--muted);
      font-weight: 900;
      min-width: 20px;
      text-align: right;
    }

.meta .tag {
      background: rgba(30, 41, 59, 0.85);
      border: 1px solid rgba(148, 163, 184, 0.14);
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 0.78rem;
      color: var(--muted);
    }

.star-btn {
      min-width: 44px;
      padding-inline: 0;
      text-align: center;
      font-size: 1rem;
    }

.card-body {
      padding: 0 16px 16px;
      border-top: 1px solid rgba(148, 163, 184, 0.12);
    }

.fields {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }

.field-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

.field-grid.single {
      grid-template-columns: 1fr;
    }

.field-small label {
      margin-top: 0;
      font-size: 0.8rem;
      color: var(--muted);
      font-weight: 700;
    }

.card-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 14px;
    }

.small-muted {
      font-size: 0.8rem;
      color: var(--muted);
    }

.status {
      margin-top: 14px;
      min-height: 22px;
      font-weight: 700;
      font-size: 0.94rem;
    }

.status.ok { color: #86efac; }

.status.warn { color: #fde68a; }

.status.err { color: #fca5a5; }

.inline-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

.footer-note {
      margin-top: 18px;
      color: var(--muted);
      font-size: 0.84rem;
      line-height: 1.45;
    }

.cloud-strip {
      margin-top: 18px;
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: center;
      flex-wrap: wrap;
      padding: 14px 16px;
      border-radius: 18px;
      background: rgba(15, 23, 42, 0.72);
      border: 1px solid rgba(148, 163, 184, 0.14);
    }

.cloud-strip-copy {
      color: var(--muted);
      font-size: 0.92rem;
      line-height: 1.45;
    }

.branch-nav {
      position: sticky;
      top: 14px;
      z-index: 70;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      padding: 14px;
      margin-bottom: 18px;
      border-radius: 24px;
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      background: linear-gradient(180deg, rgba(24,27,35,0.84), rgba(12,14,19,0.76));
      border: 1px solid rgba(255,255,255,0.10);
      box-shadow: 0 18px 45px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.035);
    }

.branch-brand {
      display: inline-flex;
      align-items: center;
      gap: 13px;
      min-width: 0;
      color: inherit;
      text-decoration: none;
    }

.branch-mark {
      width: 46px;
      height: 46px;
      border-radius: 16px;
      display: grid;
      place-items: center;
      font-weight: 900;
      letter-spacing: -0.08em;
      color: #071018;
      background:
        radial-gradient(circle at 28% 24%, rgba(255,255,255,0.22), transparent 30%),
        linear-gradient(135deg, rgba(255,159,202,0.96), rgba(246,211,138,0.92));
      box-shadow: 0 14px 30px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.18);
    }

.branch-meta { min-width: 0; }

.branch-kicker {
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      font-weight: 800;
      margin-bottom: 3px;
    }

.branch-name {
      font-size: 18px;
      font-weight: 900;
      letter-spacing: -0.03em;
      white-space: nowrap;
    }

.branch-links {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
    }

.branch-link,
    .profile-trigger,
    .drawer-close {
      appearance: none;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.04);
      color: var(--text);
      border-radius: 999px;
      padding: 10px 13px;
      font: inherit;
      font-size: 13px;
      font-weight: 800;
      text-decoration: none;
      cursor: pointer;
      transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
      white-space: nowrap;
    }

.branch-link:hover,
    .profile-trigger:hover,
    .drawer-close:hover {
      transform: translateY(-1px);
      border-color: rgba(255,255,255,0.18);
      background: rgba(255,255,255,0.07);
    }

.branch-link.active {
      background: rgba(255,159,202,0.15);
      border-color: rgba(255,159,202,0.34);
      color: #ffd8e9;
    }

.branch-link.atlas:hover { border-color: rgba(182,148,255,0.42); background: rgba(182,148,255,0.14); color: #eadfff; box-shadow: 0 10px 24px rgba(182,148,255,0.10); }

.branch-link.kana:hover { border-color: rgba(103,215,139,0.42); background: rgba(103,215,139,0.14); color: #c9f7d8; box-shadow: 0 10px 24px rgba(103,215,139,0.10); }

.branch-link.words:hover { border-color: rgba(255,159,202,0.42); background: rgba(255,159,202,0.13); color: #ffd8e9; box-shadow: 0 10px 24px rgba(255,159,202,0.10); }

.profile-trigger:hover { border-color: rgba(246,211,138,0.44); background: rgba(246,211,138,0.13); color: #fff0c3; }

.profile-trigger {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      padding: 8px 9px 8px 12px;
      background: rgba(255,255,255,0.055);
    }

.profile-dot {
      width: 26px;
      height: 26px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      font-size: 12px;
      font-weight: 900;
      background: linear-gradient(135deg, rgba(255,159,202,0.96), rgba(246,211,138,0.92));
      color: #071018;
    }

.drawer-backdrop {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: none;
      background: rgba(0,0,0,0.52);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

.drawer-backdrop.open { display: block; }

.profile-drawer {
      position: fixed;
      top: 18px;
      right: 18px;
      z-index: 90;
      width: min(390px, calc(100vw - 36px));
      max-height: calc(100vh - 36px);
      overflow-y: auto;
      padding: 18px;
      border-radius: 28px;
      background:
        radial-gradient(circle at top right, rgba(255,159,202,0.18), transparent 34%),
        linear-gradient(180deg, rgba(22,25,34,0.98), rgba(9,11,16,0.98));
      border: 1px solid rgba(255,255,255,0.10);
      box-shadow: 0 32px 90px rgba(0,0,0,0.55);
      transform: translateX(calc(100% + 40px));
      transition: transform 0.24s ease;
    }

.profile-drawer.open { transform: translateX(0); }

.drawer-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      margin-bottom: 18px;
    }

.drawer-title {
      font-size: 20px;
      font-weight: 900;
      letter-spacing: -0.03em;
    }

.drawer-close { padding: 8px 11px; border-radius: 12px; }

.drawer-user {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px;
      border-radius: 20px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.08);
      margin-bottom: 14px;
    }

.drawer-avatar {
      width: 56px;
      height: 56px;
      border-radius: 18px;
      object-fit: cover;
      display: none;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.08);
    }

.drawer-name { font-size: 17px; font-weight: 900; margin-bottom: 4px; }

.drawer-email, .drawer-status { color: var(--muted); font-size: 13px; line-height: 1.45; }

.drawer-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 14px;
    }

.drawer-action {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 42px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.10);
      background: rgba(255,255,255,0.05);
      color: var(--text);
      text-decoration: none;
      font-weight: 800;
      font-size: 13px;
      cursor: pointer;
    }

.drawer-action.primary {
      background: rgba(255,159,202,0.16);
      border-color: rgba(255,159,202,0.30);
    }

.hero-titleline {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: #ffd8e9;
      font-size: 12px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      margin-bottom: 12px;
    }

.wrap { width: min(1260px, calc(100% - 32px)); }

.branch-nav {
      background: linear-gradient(180deg, rgba(14,18,30,0.86), rgba(7,9,18,0.78));
      border-color: rgba(255,255,255,0.105);
      box-shadow: 0 18px 45px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.035);
    }

.branch-mark {
      color: #071018;
      background:
        radial-gradient(circle at 28% 24%, rgba(255,255,255,0.22), transparent 30%),
        linear-gradient(135deg, rgba(255,159,202,0.96), rgba(246,211,138,0.92));
    }

.branch-link, .profile-trigger {
      background: transparent;
      border-color: transparent;
      color: #cfd5e2;
    }

.profile-trigger {
      background: rgba(255,255,255,0.06);
      border-color: rgba(255,255,255,0.08);
    }

.profile-dot {
      width: 22px;
      height: 22px;
      font-size: 11px;
      background: linear-gradient(135deg, #81e4ad, #84bbff);
      overflow: hidden;
    }

.profile-dot img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }

.profile-drawer {
      top: 16px;
      right: 16px;
      bottom: 16px;
      width: min(420px, calc(100vw - 32px));
      max-height: none;
      border-radius: 32px;
      padding: 22px;
      background:
        radial-gradient(circle at 88% 10%, rgba(125,181,255,0.18), transparent 30%),
        linear-gradient(180deg, rgba(19,24,39,0.96), rgba(7,9,18,0.98));
    }

.drawer-head { margin-bottom: 22px; }

.drawer-title { font-size: 24px; line-height: 1; }

.drawer-close { width: 42px; height: 42px; border-radius: 999px; padding: 0; font-size: 18px; }

.drawer-user { border-radius: 26px; padding: 18px; margin-bottom: 14px; }

.drawer-avatar { width: 66px; height: 66px; border-radius: 22px; }

.drawer-name { font-size: 19px; }

.drawer-actions { grid-template-columns: 1fr; gap: 10px; }

.drawer-action { min-height: 46px; border-radius: 16px; font-weight: 900; }

.drawer-action.primary {
      background: linear-gradient(135deg, rgba(125,181,255,0.28), rgba(181,150,255,0.20));
      border-color: rgba(125,181,255,0.26);
    }

.cloud-strip { display: none !important; }

.grid { grid-template-columns: 340px minmax(0, 1fr); }

.card-summary {
      grid-template-columns: minmax(260px, 1.75fr) minmax(150px, 0.8fr) minmax(130px, 0.7fr) minmax(140px, auto) 24px;
      gap: 16px;
      align-items: center;
    }

.card-summary-main { min-width: 260px; }

.kana {
      line-height: 1.18;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

.summary-value { white-space: normal; }

.hero {
      background:
        radial-gradient(circle at 16% 10%, rgba(255,159,202,0.15), transparent 30%),
        radial-gradient(circle at 90% 12%, rgba(246,211,138,0.12), transparent 28%),
        linear-gradient(135deg, rgba(31,25,37,0.90), rgba(10,14,24,0.94));
    }

@media (max-width: 980px) {
      .grid {
        grid-template-columns: 1fr;
      }

      .branch-nav { align-items: flex-start; flex-direction: column; }
      .branch-links { justify-content: flex-start; }
      .profile-trigger { width: 100%; justify-content: space-between; }
      .drawer-actions { grid-template-columns: 1fr; }

      .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .toolbar { grid-template-columns: 1fr; }
    }

@media (max-width: 800px) {
      .card-summary {
        grid-template-columns: 1fr 1fr;
      }

      .summary-date,
      .summary-toggle {
        text-align: left;
      }
    }

@media (max-width: 640px) {
      .wrap { width: min(100% - 20px, 100%); margin-top: 18px; }
      .hero, .panel-inner { padding: 16px; }
      .stats { grid-template-columns: 1fr 1fr; }
      .field-grid { grid-template-columns: 1fr; }
      .card-top { flex-direction: column; }
      .card-summary { grid-template-columns: 1fr; }
      .card-summary-main { min-width: 0; }
    }

.footer-note strong, .footer-note br { display: none; }

.footer-note { display: none !important; }

.drawer-status .ma-sync-badge { margin-top: 8px; }

.card-summary {
  grid-template-columns: minmax(220px, 1.85fr) minmax(130px, 1fr) minmax(110px, 0.8fr) minmax(130px, auto) auto !important;
}

.kana { overflow-wrap: anywhere; line-height: 1.15; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr !important; }
  .card-summary {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
  }
  .card-summary-main { grid-column: 1 / -1; }
  .summary-col { display: none; }
  .summary-toggle { grid-column: 2; grid-row: 1; align-self: start; }
  .kana { font-size: clamp(1.55rem, 7vw, 2.05rem) !important; }
  .romaji { font-size: 1rem !important; }
}

@media (max-width: 640px) {
  .pill-row { gap: 8px !important; }
  .pill { padding: 7px 10px !important; font-size: 0.82rem !important; }
  .stats { gap: 10px !important; }
  .stat { padding: 14px !important; border-radius: 18px !important; }
  .stat .value { font-size: 1.7rem !important; }
  .toolbar { gap: 10px !important; }
  .panel h2 { font-size: 1.1rem !important; }
}

@media (max-width: 760px) {
  .branch-links .profile-trigger { order: 99 !important; }
  .branch-links { -webkit-overflow-scrolling: touch; }
  .branch-links::-webkit-scrollbar { display: none !important; }
}
