:root {
  --ink: #182237;
  --muted: #6f7b90;
  --line: #e4e8ef;
  --canvas: #f4f6f9;
  --card: #ffffff;
  --navy: #17233a;
  --blue: #3568e8;
  --blue-dark: #2455cf;
  --blue-soft: #edf3ff;
  --green: #1a9a6b;
  --amber: #cc8123;
  --red: #d84e5e;
  --shadow: 0 12px 36px rgba(25, 39, 66, .07);
  --radius: 18px;
  font-family: Inter, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

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

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; padding: 26px 18px 20px;
  display: flex; flex-direction: column; color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(76, 112, 199, .28), transparent 34%),
    linear-gradient(165deg, #1a2944 0%, #121d31 100%);
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 37px; }
.brand-mark {
  width: 40px; height: 40px; display: inline-grid; place-items: center; flex: 0 0 auto;
  color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.03em;
  border-radius: 12px; background: linear-gradient(145deg, #4a7df2, #315cd2);
  box-shadow: 0 8px 20px rgba(37, 84, 207, .38);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: #99a7bd; font-size: 11px; }
.main-nav { display: grid; gap: 7px; }
.main-nav a {
  display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 14px;
  color: #aeb9c9; border-radius: 11px; font-size: 14px; font-weight: 650;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.main-nav a span { width: 20px; color: #7e90ab; text-align: center; font-size: 19px; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.06); transform: translateX(2px); }
.main-nav a.is-active { color: #fff; background: rgba(80, 122, 226, .2); box-shadow: inset 3px 0 #5c86ee; }
.main-nav a.is-active span { color: #82a4f7; }
.sidebar-note {
  display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 13px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.035);
}
.status-dot { width: 8px; height: 8px; border-radius: 99px; background: #4bd3a1; box-shadow: 0 0 0 5px rgba(75,211,161,.09); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { margin-top: 2px; color: #8e9bb0; font-size: 10px; }
.version { margin: 13px 0 0; color: #5f6c82; text-align: center; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

.main-panel { grid-column: 2; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  min-height: 94px; padding: 20px clamp(24px, 4vw, 56px); display: flex; align-items: center; gap: 18px;
  border-bottom: 1px solid rgba(222, 227, 235, .9); background: rgba(255,255,255,.86);
  backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20;
}
.topbar > div { flex: 1; }
.eyebrow { margin: 0 0 5px; color: #8490a2; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.topbar h1 { margin: 0; font-size: clamp(21px, 2.3vw, 28px); letter-spacing: -.04em; }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.content { width: 100%; max-width: 1560px; margin: 0 auto; padding: 34px clamp(24px, 4vw, 56px) 60px; flex: 1; }
footer { padding: 18px clamp(24px, 4vw, 56px); display: flex; justify-content: space-between; color: #98a1b0; border-top: 1px solid var(--line); font-size: 10px; }

.primary-button, .secondary-button, .text-button {
  min-height: 42px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 750; transition: .16s ease;
}
.primary-button { color: #fff; background: var(--blue); box-shadow: 0 7px 16px rgba(53,104,232,.2); }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button.compact { min-height: 41px; padding-inline: 16px; }
.secondary-button { color: #354158; background: #fff; border: 1px solid var(--line); }
.secondary-button:hover { border-color: #bdc6d5; background: #fafbfc; }
.text-button { color: var(--muted); padding-inline: 6px; }
.full-button { width: 100%; }

.alert {
  display: flex; align-items: flex-start; gap: 11px; margin-bottom: 22px; padding: 14px 16px;
  border: 1px solid; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-size: 13px;
}
.alert > span { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 99px; color: #fff; font-size: 11px; font-weight: 900; }
.alert p { margin: 2px 0; flex: 1; line-height: 1.6; }
.alert button { border: 0; background: transparent; color: #8e98a8; cursor: pointer; font-size: 19px; }
.alert-success { border-color: #bfe7d6; color: #167853; }
.alert-success > span { background: var(--green); }
.alert-warning { border-color: #f1d8b2; color: #865a19; }
.alert-warning > span, .alert-error > span { background: var(--amber); }
.alert-error { border-color: #f3c4cb; color: #9b3543; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  min-height: 114px; padding: 20px; display: flex; align-items: center; gap: 15px;
  border: 1px solid #e7eaf0; border-radius: 15px; background: #fff; box-shadow: 0 5px 20px rgba(30,47,78,.035);
  transition: transform .16s ease, box-shadow .16s ease;
}
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; font-size: 19px; font-weight: 800; }
.stat-icon.blue { color: #3468e3; background: #ecf2ff; }
.stat-icon.amber { color: #bd7620; background: #fff5e5; }
.stat-icon.red { color: #d04b5a; background: #fff0f2; }
.stat-icon.green { color: #188d64; background: #eaf9f3; }
.stat-card small, .stat-card em { display: block; }
.stat-card small { margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-card strong { font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.stat-card em { display: inline; margin-left: 5px; color: #a4adba; font-size: 9px; font-style: normal; text-transform: uppercase; }

.list-card, .form-card, .api-card {
  border: 1px solid #e4e8ef; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
}
.search-bar { padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--line); }
.search-input { min-width: 240px; flex: 1; position: relative; }
.search-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-53%); color: #8b96a6; font-size: 22px; }
.search-input input, .search-bar select {
  width: 100%; min-height: 42px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fafbfc;
}
.search-input input { padding: 0 14px 0 42px; }
.search-bar select { width: 170px; padding: 0 34px 0 12px; }
.month-filter { width: 165px; min-height: 42px; padding: 0 9px 0 11px; display: flex; align-items: center; gap: 6px; color: #7c8798; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.month-filter span { flex: 0 0 auto; font-size: 9px; font-weight: 750; }
.month-filter input { min-width: 0; width: 100%; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 10px; }
.search-input input:focus, .search-bar select:focus, .month-filter:focus-within, .field input:focus, .field select:focus, .field textarea:focus { border-color: #7a9bf0; box-shadow: 0 0 0 3px rgba(53,104,232,.1); background: #fff; }
.list-summary { min-height: 52px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.list-summary p { margin: 0; color: var(--muted); font-size: 12px; }
.list-summary p strong { color: var(--ink); }
.list-summary a { color: var(--blue); font-size: 11px; font-weight: 750; }
.list-actions { display: flex; align-items: center; gap: 16px; }
.list-actions .export-link { color: #197b5a; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 13px 15px; color: #8893a4; background: #f9fafc; text-align: left; font-size: 10px; letter-spacing: .04em; }
th:first-child, td:first-child { padding-left: 22px; }
td { padding: 16px 15px; border-top: 1px solid #edf0f4; font-size: 12px; vertical-align: middle; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #fafcff; }
.project-link { display: flex; align-items: center; gap: 10px; }
.project-link strong { display: block; font-size: 13px; }
.project-summary { min-width: 180px; }
.project-summary small { display: block; max-width: 300px; margin-top: 4px; color: #7d8899; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
.project-id { min-width: 41px; padding: 4px 5px; color: #728099; border-radius: 6px; background: #eff2f6; font-family: ui-monospace, monospace; font-size: 9px; text-align: center; }
.avatar-stack { min-height: 26px; display: flex; align-items: center; padding-left: 7px; }
.avatar-stack span { width: 27px; height: 27px; margin-left: -7px; display: grid; place-items: center; color: #3154a8; border: 2px solid #fff; border-radius: 50%; background: #dfe8ff; font-size: 9px; font-weight: 800; }
.avatar-stack span:nth-child(2) { color: #75509e; background: #eee2fa; }
.avatar-stack span:nth-child(3) { color: #866332; background: #f7e9ce; }
.avatar-stack span:nth-child(4) { color: #647084; background: #e9edf3; }
.avatar-stack span.external { color: #a46416; background: #fff0d6; box-shadow: inset 0 0 0 1px #ebc47f; }
.avatar-stack em { color: #a1a9b6; font-size: 10px; font-style: normal; }
.mono { color: #515d70; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.status-chip, .source-chip, .history-action {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 99px; font-size: 9px; font-weight: 800;
}
.status-chip.neutral { color: #7c8798; background: #f0f2f5; }
.status-chip.success { color: #18865f; background: #e8f7f1; }
.status-chip.notice { color: #4971c9; background: #edf3ff; }
.status-chip.warning { color: #a46616; background: #fff3df; }
.status-chip.danger { color: #bc4252; background: #fff0f2; }
.project-status { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 7px; font-size: 9px; font-weight: 800; }
.project-status.status-live { color: #157957; background: #e5f7ef; }
.project-status.status-building { color: #315fc8; background: #eaf0ff; }
.project-status.status-canceling { color: #a26817; background: #fff3dd; }
.project-status.status-canceled { color: #7d8796; background: #eceff3; }
.project-status.status-stopped { color: #ba3f50; background: #ffedf0; }
.project-status.status-other { color: #78549b; background: #f2eafa; }
.environment { display: flex; gap: 5px; }
.environment span { padding: 4px 6px; color: #697489; border: 1px solid #e5e8ee; border-radius: 5px; font-family: ui-monospace, monospace; font-size: 8px; }
.date-cell { color: #798497; font-size: 10px; }
.row-actions { display: flex; gap: 5px; }
.row-actions a { width: 29px; height: 29px; display: grid; place-items: center; color: #71809a; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; }
.row-actions a:hover { color: var(--blue); border-color: #b8c8ee; }
.pagination { padding: 15px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--line); }
.pagination a { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; }
.pagination a.disabled { opacity: .35; pointer-events: none; }
.pagination span { color: var(--muted); font-size: 11px; }
.empty-state { padding: 64px 24px; text-align: center; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 16px; display: grid; place-items: center; color: #7990c8; border-radius: 50%; background: #edf2fc; font-size: 25px; }
.empty-state h2 { margin: 0 0 8px; font-size: 17px; }
.empty-state p { margin: 0 0 22px; color: var(--muted); font-size: 12px; }

.page-heading { min-height: 50px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.page-heading .domain-label { margin-bottom: 3px; color: var(--ink); font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.project-form { display: grid; gap: 16px; }
.form-card { padding: 25px 28px 28px; }
.card-heading { margin-bottom: 23px; display: flex; align-items: center; gap: 13px; }
.step-badge { min-width: 39px; height: 34px; padding: 0 8px; display: grid; place-items: center; color: #4d71c9; border-radius: 9px; background: #edf3ff; font-family: ui-monospace, monospace; font-size: 10px; font-weight: 800; }
.card-heading h2 { margin: 0; font-size: 15px; }
.card-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: minmax(0, 1.5fr) minmax(150px, .65fr) minmax(0, 1fr); }
.basic-secondary { margin-top: 18px; }
.field { display: grid; gap: 7px; }
.field-label { color: #4d596d; font-size: 11px; font-weight: 750; }
.field-label b { margin-left: 7px; padding: 2px 5px; color: #b43b4a; border-radius: 4px; background: #fff0f2; font-size: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0 13px; color: var(--ink); border: 1px solid #dfe4eb; border-radius: 9px; outline: 0; background: #fbfcfd;
}
.field input, .field select { min-height: 43px; }
.field textarea { min-height: 120px; padding-block: 12px; resize: vertical; line-height: 1.7; }
.field input::placeholder, .field textarea::placeholder { color: #b0b7c2; }
.field.full { margin-top: 20px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #e18792; background: #fffafb; }
.field small { color: var(--red); font-size: 10px; }
.staff-field input.is-external-name { color: #895a16; border-color: #d9ae67; background: #fffaf0; }
.external-name-note { color: #a06716 !important; }
.inline-note {
  margin: -4px 0 18px; padding: 10px 12px; color: #63718a; border: 1px solid #dce4f3;
  border-radius: 9px; background: #f6f9ff; font-size: 10px; line-height: 1.6;
}
.inline-note a { color: var(--blue); font-weight: 750; }
.success-note { color: #34775f; border-color: #cce7db; background: #f1faf6; }
.form-actions { padding: 8px 0 0; display: flex; justify-content: flex-end; gap: 10px; }

.timeline { max-width: 980px; }
.timeline-item { display: grid; grid-template-columns: 28px 1fr; }
.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail::after { content: ""; position: absolute; top: 22px; bottom: -8px; width: 1px; background: #d9dfe8; }
.timeline-item:last-child .timeline-rail::after { display: none; }
.timeline-rail span { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 21px; border: 3px solid var(--canvas); border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #9eb5ec; }
.history-card { margin: 0 0 14px 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(30,47,78,.035); }
.history-head { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.history-head > div { display: flex; align-items: center; gap: 10px; }
.history-action { color: #315fc8; background: var(--blue-soft); }
.history-head strong { font-size: 11px; }
.source-chip { color: #68758a; background: #f0f2f5; }
.change-list { display: grid; gap: 7px; }
.change-row { min-height: 37px; padding: 8px 11px; display: grid; grid-template-columns: 155px minmax(0,1fr) 16px minmax(0,1fr); align-items: center; gap: 8px; border-radius: 8px; background: #f8f9fb; font-size: 11px; }
.change-row > span { color: #69758a; font-size: 10px; font-weight: 700; }
.change-row del { color: #a75b65; text-decoration: line-through; overflow-wrap: anywhere; white-space: pre-wrap; }
.change-row ins, .change-row .created-value { color: #267757; font-style: normal; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; white-space: pre-wrap; }
.change-row b { color: #a8b0bc; text-align: center; }
.change-row .created-value { grid-column: 2 / -1; }

.import-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .65fr); gap: 18px; align-items: start; }
.upload-card { min-height: 420px; }
.drop-zone { min-height: 225px; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #aab9dd; border-radius: 13px; background: #f8faff; cursor: pointer; text-align: center; }
.drop-zone:hover { border-color: var(--blue); background: #f4f7ff; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { width: 46px; height: 46px; margin-bottom: 13px; display: grid; place-items: center; color: var(--blue); border-radius: 13px; background: #e7eeff; font-size: 24px; }
.drop-zone strong { font-size: 14px; }
.drop-zone small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.drop-zone em { margin-top: 14px; padding: 5px 9px; color: #5a6c94; border-radius: 6px; background: #eaf0fd; font-size: 9px; font-style: normal; }
.upload-card form > .primary-button { margin-top: 16px; }
.guide-card { padding: 27px; color: #fff; border-radius: var(--radius); background: linear-gradient(155deg, #1b2b49, #152037); box-shadow: var(--shadow); }
.guide-card .eyebrow { color: #6e86b5; }
.guide-card h2 { margin: 0 0 24px; font-size: 18px; }
.guide-card ol { margin: 0 0 28px; padding: 0; display: grid; gap: 16px; list-style: none; }
.guide-card li { display: flex; align-items: center; gap: 11px; color: #c7d0df; font-size: 11px; }
.guide-card li span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; color: #93aef2; border: 1px solid #405273; border-radius: 50%; font-size: 9px; }
.guide-card .secondary-button { color: #dce4f1; border-color: #3b4c69; background: rgba(255,255,255,.04); }
.tiny-note { margin: 14px 0 0; color: #73819a; font-size: 9px; line-height: 1.7; }

.api-card { max-width: 1000px; padding: 28px; }
.api-method { display: flex; align-items: center; gap: 11px; }
.api-method span { padding: 5px 8px; color: #147d58; border-radius: 6px; background: #e5f7ef; font-size: 9px; font-weight: 900; }
.api-method code { color: #69758a; font-size: 11px; }
.api-card h2 { margin: 25px 0 12px; font-size: 18px; }
.api-card h3 { margin: 25px 0 10px; font-size: 12px; }
.code-block { padding: 15px; display: flex; align-items: center; gap: 10px; border-radius: 10px; background: #17243b; }
.code-block code { flex: 1; color: #cbd8f4; overflow-x: auto; white-space: nowrap; font-size: 10px; }
.code-block button { padding: 6px 8px; color: #dfe7f5; border: 1px solid #40506a; border-radius: 6px; background: #25334c; cursor: pointer; font-size: 9px; }
.parameter-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.parameter-list > div { min-height: 46px; padding: 0 13px; display: grid; grid-template-columns: 150px 1fr 45px; align-items: center; border-top: 1px solid var(--line); font-size: 10px; }
.parameter-list > div:first-child { border-top: 0; }
.parameter-list code { color: #345fc2; font-weight: 700; }
.parameter-list span { color: #667287; }
.parameter-list em { color: #9ca5b3; font-size: 9px; font-style: normal; }
.field-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.field-chips code { padding: 6px 8px; color: #4e5d75; border: 1px solid var(--line); border-radius: 6px; background: #f8f9fb; font-size: 9px; }
.api-note { margin-top: 26px; padding: 14px 16px; border-left: 3px solid var(--blue); background: var(--blue-soft); }
.api-note strong { font-size: 11px; }
.api-note p { margin: 4px 0 0; color: #5c6c8e; font-size: 10px; line-height: 1.7; }
.api-note code { color: #335bae; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 18px; align-items: start; }
.settings-form { display: grid; gap: 17px; }
.settings-form .form-grid { margin-top: 1px; }
.credential-note { margin: -2px 0 3px; padding: 11px 12px; display: flex; gap: 9px; color: #69768a; border-radius: 9px; background: #f7f8fa; }
.credential-note span { color: #38a47b; font-size: 9px; }
.credential-note p { margin: 0; font-size: 9px; line-height: 1.7; }
.directory-card { overflow: hidden; border-radius: var(--radius); background: #182641; box-shadow: var(--shadow); }
.directory-head { padding: 25px 25px 15px; display: flex; align-items: flex-start; justify-content: space-between; color: #fff; }
.directory-head .eyebrow { color: #7289b3; }
.directory-head h2 { margin: 0; font-size: 17px; }
.directory-head > strong { font-size: 28px; letter-spacing: -.04em; }
.directory-head > strong small { margin-left: 3px; color: #8fa0bd; font-size: 9px; font-weight: 600; }
.sync-time { margin: 0; padding: 0 25px 15px; color: #8291aa; font-size: 9px; }
.staff-list { max-height: 420px; padding: 6px 15px 16px; overflow-y: auto; scrollbar-color: #40506a transparent; }
.staff-list > div { padding: 10px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.06); }
.staff-list > div > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: #9cb6f1; border-radius: 9px; background: #263858; font-size: 10px; font-weight: 800; }
.staff-list p { margin: 0; min-width: 0; }
.staff-list strong, .staff-list small { display: block; }
.staff-list strong { color: #eef3fb; font-size: 11px; }
.staff-list small { margin-top: 2px; color: #7889a4; font-size: 8px; }
.directory-empty { min-height: 210px; display: grid; place-content: center; color: #7889a4; text-align: center; }
.directory-empty span { font-size: 30px; }
.directory-empty p { font-size: 10px; }
.directory-card > .tiny-note { padding: 0 24px 18px; }

.fatal-wrap { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.fatal-card { width: min(520px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.fatal-card .brand-mark { margin-bottom: 15px; }
.fatal-card h1 { margin: 0 0 12px; font-size: 21px; }
.fatal-card p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.fatal-card .muted { color: #a0a8b5; font-size: 10px; }
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { min-height: 96px; }
}

@media (max-width: 880px) {
  .app-shell { display: block; }
  .main-panel { min-width: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 15px 0 40px rgba(11,20,37,.22); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(13,22,38,.45); backdrop-filter: blur(2px); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .menu-button { display: block; }
  .topbar { min-height: 82px; padding-block: 15px; }
  .import-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .guide-card { order: -1; }
}

@media (max-width: 680px) {
  .content { padding: 24px 15px 45px; }
  .topbar { padding-inline: 15px; }
  .topbar .primary-button { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat-card { min-height: 88px; padding: 14px 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-card strong { font-size: 22px; }
  .stat-card em { display: none; }
  .search-bar { flex-wrap: wrap; padding: 14px; }
  .search-input { flex-basis: 100%; }
  .search-bar select { flex: 1; width: auto; }
  .month-filter { flex: 1; width: auto; }
  .list-summary { align-items: flex-start; gap: 10px; padding-block: 13px; }
  .list-actions { align-items: flex-end; flex-direction: column; gap: 7px; }
  .form-card, .api-card { padding: 20px 16px; }
  .form-grid, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; gap: 15px; }
  .page-heading { align-items: flex-start; }
  .page-heading .secondary-button { flex: 0 0 auto; }
  .form-actions { position: sticky; bottom: 10px; z-index: 8; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
  .form-actions > * { flex: 1; }
  .change-row { grid-template-columns: 1fr; gap: 5px; }
  .change-row > span { margin-bottom: 3px; }
  .change-row b { transform: rotate(90deg); text-align: left; }
  .change-row .created-value { grid-column: auto; }
  .parameter-list > div { grid-template-columns: 95px 1fr; padding-block: 10px; }
  .parameter-list em { display: none; }
  footer { display: block; text-align: center; }
  footer span { display: block; margin: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
