:root {
  --navy: #0d2f3c;
  --deep: #082631;
  --teal: #08786f;
  --mint: #70c2b2;
  --paper: #f2f5f3;
  --line: #d9e0dd;
  --text: #284650;
  --muted: #71858b;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: var(--text);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.brand { display: inline-flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { color: #69b9ab; font: 700 13px/1 Arial, sans-serif; letter-spacing: .12em; }
.brand > span:last-child { display: grid; gap: 3px; color: #122f3d; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.brand small { color: #7f9195; font-size: 8px; font-weight: 500; letter-spacing: .12em; }

.auth-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(420px, .65fr); min-height: 100vh; }
.auth-message { position: relative; overflow: hidden; padding: 54px clamp(44px, 7vw, 120px); color: white; background: linear-gradient(145deg, var(--deep), #124b58); }
.auth-message::before, .auth-message::after { content: ""; position: absolute; border: 1px solid rgba(112,194,178,.14); border-radius: 50%; }
.auth-message::before { width: 650px; height: 650px; right: -280px; bottom: -390px; }
.auth-message::after { width: 410px; height: 410px; right: -160px; bottom: -270px; }
.auth-brand > span:last-child { color: white; }
.auth-brand small { color: #9cb4b7; }
.eyebrow { margin: 0 0 24px; color: #83cbbc; font: 700 10px/1 Arial, sans-serif; letter-spacing: .18em; }
.eyebrow.teal { color: var(--teal); }
.auth-message .eyebrow { margin-top: clamp(80px, 14vh, 150px); }
.auth-message h1 { margin: 0; max-width: 720px; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(42px, 5vw, 76px); font-weight: 400; line-height: 1.28; letter-spacing: -.04em; }
.lead { max-width: 650px; margin: 38px 0 0; color: #c1d3d4; font-size: 14px; line-height: 2; }
.trust-list { display: grid; max-width: 650px; margin: 50px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.18); }
.trust-list li { display: grid; grid-template-columns: 45px 1fr; gap: 4px 15px; padding: 19px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.trust-list li > span { grid-row: span 2; color: #78c6b8; font: 700 9px Arial, sans-serif; }
.trust-list strong { font-size: 12px; }
.trust-list small { color: #8faeb1; font-size: 9px; }

.auth-card { align-self: center; margin: 45px clamp(28px, 5vw, 78px); padding: 50px clamp(28px, 4vw, 55px); border-top: 3px solid var(--teal); background: white; box-shadow: 0 22px 60px rgba(12,47,60,.08); }
.auth-card.compact { width: min(520px, calc(100% - 30px)); margin: 30px auto; }
.auth-card h1, .auth-card h2 { margin: 0 0 12px; color: #143845; font-family: Georgia, "Yu Mincho", serif; font-size: 30px; font-weight: 500; }
.auth-card > p { color: var(--muted); font-size: 11px; line-height: 1.8; }
.stack-form { display: grid; gap: 18px; margin-top: 28px; }
.stack-form label, .upload-form label { display: grid; gap: 8px; color: #425f67; font-size: 10px; font-weight: 700; }
.stack-form input, .stack-form select, .upload-form input, .upload-form select { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #cfd9d6; border-radius: 0; color: #143845; background: white; outline: none; }
.stack-form input:focus, .stack-form select:focus, .upload-form input:focus, .upload-form select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,120,111,.09); }
.primary { display: inline-flex; justify-content: space-between; align-items: center; min-height: 50px; padding: 0 20px; border: 0; background: var(--teal); color: white; font-size: 11px; font-weight: 800; letter-spacing: .06em; cursor: pointer; text-decoration: none; }
.primary:hover { background: #075e59; }
.link-button { justify-content: center; margin-top: 25px; }
.security-note { display: flex; gap: 13px; align-items: center; margin-top: 26px; padding: 15px; background: #f1f7f5; }
.security-note > b { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--teal); color: white; }
.security-note p { display: grid; gap: 3px; margin: 0; font-size: 9px; }
.security-note span { color: #7a8d92; }
.support { margin-top: 28px !important; text-align: center; }
.support strong { color: #294b55; }
.notice { margin: 18px 0; padding: 13px 15px; border-left: 3px solid #a24d45; background: #fbefed; color: #814038; font-size: 11px; line-height: 1.7; }
.notice.success { border-color: #198071; background: #eaf6f2; color: #176b62; }
.center-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: linear-gradient(145deg, #eaf0ed, #f8faf8); }
.mfa-setup { display: grid; justify-items: center; margin: 20px 0; padding: 18px; border: 1px solid var(--line); background: #f8faf8; text-align: center; }
.mfa-setup p { margin-top: 0; font-size: 11px; line-height: 1.7; }
.mfa-setup img { padding: 7px; background: white; }
.mfa-setup details { margin-top: 12px; color: var(--muted); font-size: 9px; }
.mfa-setup code { display: block; margin-top: 8px; padding: 8px; color: #183d49; background: white; font-size: 11px; overflow-wrap: anywhere; }
.otp-input { font: 500 28px/1 Arial, sans-serif !important; letter-spacing: .32em; text-align: center; }
.microcopy { margin-top: 20px; color: #88999d !important; font-size: 9px !important; }

.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 74px; padding: 0 clamp(18px, 4vw, 60px); border-bottom: 1px solid var(--line); background: white; }
.topbar nav { display: flex; gap: 22px; align-items: center; color: #567078; font-size: 10px; font-weight: 700; }
.topbar nav a { text-decoration: none; }
.topbar nav form { margin: 0; }
.topbar nav button { padding: 8px 12px; border: 1px solid var(--line); background: white; color: #567078; cursor: pointer; }
.workspace { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 52px 0 80px; }
.welcome { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.welcome h1 { margin: 0 0 10px; color: #123746; font-family: Georgia, "Yu Mincho", serif; font-size: 42px; font-weight: 500; }
.welcome > div:first-child > p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.account { display: flex; gap: 11px; align-items: center; }
.account > span { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: var(--navy); color: white; }
.account p { display: grid; gap: 3px; margin: 0; font-size: 10px; }
.account small { color: var(--muted); font-size: 8px; }
.secure-banner { display: flex; gap: 10px; align-items: center; margin-top: 30px; padding: 14px 18px; border-left: 3px solid var(--teal); background: #eaf3f0; }
.secure-banner > span { color: #35a277; font-size: 9px; }
.secure-banner p { display: flex; gap: 9px; margin: 0; color: #71858b; font-size: 9px; }
.secure-banner strong { color: #385b63; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border: 1px solid var(--line); background: white; }
.stats article { display: grid; min-height: 150px; padding: 28px; border-right: 1px solid var(--line); }
.stats article:last-child { border: 0; }
.stats span { color: #60777e; font-size: 10px; font-weight: 700; }
.stats strong { color: #123746; font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.stats small { align-self: end; color: #8c9b9f; font-size: 8px; }
.stats .institution-stat { align-self: center; font-family: Arial, sans-serif; font-size: 17px; font-weight: 700; }
.stats .secure { background: #123e4a; }
.stats .secure span, .stats .secure small { color: #9bb6b8; }
.stats .secure strong { color: #74c9b8; }
.panel { margin-top: 24px; border: 1px solid var(--line); background: white; }
.reports-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; }
.panel h2 { margin: 0; color: #183d49; font-family: Georgia, "Yu Mincho", serif; font-size: 21px; font-weight: 500; }
.reports-panel header p { margin: 6px 0 0; color: #8a999d; font-size: 8px; }
.retention { font-size: 9px !important; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 18px; background: #f3f6f4; color: #71858b; font-size: 8px; text-align: left; }
td { padding: 16px 18px; border-top: 1px solid #edf0ee; color: #38555e; font-size: 10px; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: #89999d; font-size: 8px; }
.pill { display: inline-flex; padding: 6px 10px; background: #edf1ef; color: #60747a; font-size: 8px; font-weight: 800; }
.pill.published { background: #ddf0e9; color: #147068; }
.pill.draft { background: #f4eadc; color: #8d622c; }
.pill.withdrawn { background: #f5e5e3; color: #914d46; }
.download, .small-button { display: inline-flex; justify-content: center; gap: 12px; min-width: 76px; padding: 9px 12px; border: 1px solid var(--teal); background: white; color: #17645e; font-size: 9px; font-weight: 800; text-decoration: none; cursor: pointer; }
.download:hover, .small-button:hover { background: #edf7f4; }
.empty { padding: 35px; color: #8a999d; text-align: center; }
.report-cards { display: none; }
.activity-panel { padding: 28px; }
.activity-panel ul { margin: 22px 0 0; padding: 0; list-style: none; }
.activity-panel li { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid #edf0ee; color: #4a656d; font-size: 9px; }
.activity-panel time { color: #8a999d; }

.admin-workspace { width: min(1280px, calc(100% - 36px)); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.form-panel { padding: 28px; }
.form-panel > p { color: var(--muted); font-size: 10px; }
.upload-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.upload-form .primary { align-self: end; }
.file-field input { padding: 12px; }

@media (max-width: 880px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-message { min-height: auto; padding: 28px 24px 60px; }
  .auth-message .eyebrow { margin-top: 70px; }
  .auth-message h1 { font-size: 44px; }
  .auth-card { width: min(560px, calc(100% - 28px)); margin: 28px auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats article:nth-child(2) { border-right: 0; }
  .stats article:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .table-wrap { display: none; }
  .report-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
  .report-card { padding: 18px; border: 1px solid var(--line); }
  .report-card header { display: flex; justify-content: space-between; align-items: center; }
  .report-card header small { color: #89999d; font-size: 8px; }
  .report-card h3 { color: #183d49; font-size: 13px; }
  .report-card p { color: #5d737a; font-size: 9px; line-height: 1.7; }
  .report-card p span { color: #8a999d; }
  .report-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid #edf0ee; }
  .report-card dt { color: #8a999d; font-size: 8px; }
  .report-card dd { margin: 5px 0 0; font-size: 9px; }
  .download.wide { width: 100%; margin-top: 14px; }
  .admin-grid { grid-template-columns: 1fr; }
  .upload-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .auth-message h1 { font-size: 38px; }
  .auth-card { padding: 38px 22px; }
  .topbar { padding: 14px 16px; }
  .topbar nav > a { display: none; }
  .workspace { width: calc(100% - 24px); padding-top: 36px; }
  .welcome { display: grid; align-items: start; }
  .welcome h1 { font-size: 34px; }
  .account { grid-row: 1; }
  .secure-banner { align-items: flex-start; }
  .secure-banner p { display: grid; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats article { min-height: 125px; padding: 18px 15px; }
  .stats article strong { font-size: 30px; }
  .reports-panel > header { align-items: flex-start; padding: 20px 16px; }
  .report-cards { grid-template-columns: 1fr; padding: 9px; }
  .activity-panel { padding: 22px 18px; }
  .activity-panel li { display: grid; }
  .upload-form { grid-template-columns: 1fr; }
}

