:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #6d7773;
  --paper: #f4f1e8;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --line: #dedbd1;
  --brand: #143c36;
  --brand-soft: #dceae5;
  --accent: #dc6f4f;
  --gold: #d2aa57;
  --ready: #20745f;
  --soon: #b47817;
  --tracking: #8b4f91;
  --danger: #a8463a;
  --shadow: 0 16px 46px rgba(24, 39, 35, 0.09);
  --radius: 18px;
  font-family:
    Inter, "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(210, 170, 87, 0.13), transparent 32rem),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(220, 111, 79, 0.45);
  outline-offset: 2px;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--brand);
}

.boot-screen img {
  filter: drop-shadow(0 14px 20px rgba(20, 60, 54, 0.16));
}

.boot-screen strong {
  font-size: 1.35rem;
}

.boot-screen span {
  color: var(--muted);
  font-size: 0.88rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 18px 20px;
  color: #f7f5ee;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.04), transparent 40%),
    var(--brand);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 1.04rem;
  letter-spacing: 0.02em;
}

.brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-label {
  margin: 0 10px 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 3px 0 var(--gold);
}

.nav-button:active {
  transform: translateY(1px);
}

.nav-icon {
  width: 25px;
  display: inline-grid;
  place-items: center;
  font-size: 1.1rem;
}

.nav-count {
  min-width: 28px;
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 7px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.sync-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a8b4b1;
  box-shadow: 0 0 0 4px rgba(168, 180, 177, 0.12);
}

.status-dot.online {
  background: #73d7ae;
  box-shadow: 0 0 0 4px rgba(115, 215, 174, 0.14);
}

.main {
  min-width: 0;
  padding: 24px clamp(20px, 4vw, 56px) 52px;
}

.topbar {
  max-width: 1500px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-heading {
  min-width: 190px;
}

.page-heading h1 {
  margin: 0 0 3px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 620px;
  margin-left: auto;
}

.search-wrap::before {
  content: "⌕";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  font-size: 1.45rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 42px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.86);
  box-shadow: 0 5px 20px rgba(31, 49, 44, 0.04);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.search-input:focus {
  border-color: #8eaaa2;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(32, 116, 95, 0.1);
}

.clear-search {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.clear-search:hover {
  background: var(--paper);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.primary-button {
  min-height: 42px;
  padding: 0 17px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(20, 60, 54, 0.18);
  font-weight: 700;
}

.primary-button:hover {
  background: #1b5048;
  box-shadow: 0 10px 24px rgba(20, 60, 54, 0.22);
}

.secondary-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  padding: 0 15px;
  font-weight: 650;
}

.secondary-button {
  border: 1px solid #b6c9c3;
  color: var(--brand);
  background: #eff7f4;
}

.ghost-button {
  border: 1px solid var(--line);
  color: #4f5d59;
  background: var(--surface);
}

.danger-button {
  border: 1px solid #e1b1aa;
  color: var(--danger);
  background: #fff6f4;
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.danger-button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button-icon {
  margin-right: 6px;
}

.dashboard,
.content-panel,
.banner {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
}

.banner {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #d8c38d;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff8df;
  box-shadow: 0 8px 28px rgba(88, 70, 29, 0.06);
}

.banner-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #754b0b;
  background: #f3d98f;
  font-size: 1.2rem;
}

.banner-copy {
  min-width: 0;
  flex: 1;
}

.banner-copy strong,
.banner-copy span {
  display: block;
}

.banner-copy span {
  margin-top: 2px;
  color: #75694b;
  font-size: 0.78rem;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(222, 219, 209, 0.88);
  border-radius: var(--radius);
  padding: 16px 17px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 8px 28px rgba(24, 39, 35, 0.05);
  cursor: pointer;
  text-align: left;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -36px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--stat-color, var(--brand));
  opacity: 0.07;
}

.stat-card:hover {
  border-color: #bfc9c5;
  transform: translateY(-1px);
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.stat-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--stat-color, var(--brand));
}

.stat-value {
  margin-top: 9px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.stat-value strong {
  font-size: 1.8rem;
  line-height: 1;
}

.stat-value span {
  color: var(--muted);
  font-size: 0.7rem;
}

.content-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow);
}

.panel-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.result-summary {
  min-width: 0;
  flex: 1;
}

.result-summary strong {
  display: block;
  font-size: 0.93rem;
}

.result-summary span {
  color: var(--muted);
  font-size: 0.72rem;
}

.select-control {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 34px 0 11px;
  color: #48544f;
  background: var(--surface);
}

.data-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 350px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  padding: 0 12px;
  color: #65706c;
  background: #f5f4ee;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.data-table th:nth-child(1) {
  width: 32%;
}

.data-table th:nth-child(2) {
  width: 13%;
}

.data-table th:nth-child(3) {
  width: 12%;
}

.data-table th:nth-child(4) {
  width: 12%;
}

.data-table th:nth-child(5) {
  width: 9%;
}

.data-table th:nth-child(6) {
  width: 12%;
}

.data-table th:nth-child(7) {
  width: 10%;
  text-align: right;
}

.data-table td {
  height: 64px;
  border-top: 1px solid #ebe8df;
  padding: 8px 12px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: #faf8f1;
}

.title-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.cover-placeholder {
  width: 36px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px 5px 5px 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 45%),
    var(--cover, var(--brand));
  box-shadow:
    inset 3px 0 rgba(255, 255, 255, 0.16),
    0 5px 12px rgba(26, 45, 40, 0.13);
  font-family: "Yu Mincho", serif;
  font-weight: 700;
}

.title-copy {
  min-width: 0;
}

.title-copy button {
  max-width: 100%;
  overflow: hidden;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.title-copy button:hover {
  color: var(--ready);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.title-copy small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-text {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.subtle-text {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.67rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-ready {
  color: #17604e;
  background: #dcefe8;
}

.badge-soon {
  color: #8c5c0b;
  background: #fbebc9;
}

.badge-tracking {
  color: #704078;
  background: #f0e3f2;
}

.badge-waiting {
  color: #476078;
  background: #e4edf5;
}

.badge-notYet,
.badge-unknown,
.badge-complete,
.badge-hiatus {
  color: #66716d;
  background: #ebeeec;
}

.priority {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.priority.high {
  color: var(--accent);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.quick-button {
  min-height: 34px;
  border: 1px solid #b6c9c3;
  border-radius: 10px;
  padding: 0 11px;
  color: var(--brand);
  background: #eff7f4;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

.quick-button:hover {
  background: #e1f0eb;
}

.mobile-cards {
  display: none;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  border-top: 1px solid #ebe8df;
  padding: 16px;
  background: #fbfaf5;
}

.empty-state {
  min-height: 310px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 20px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 1.7rem;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state p {
  max-width: 330px;
  margin: 6px 0 16px;
  font-size: 0.8rem;
}

.bottom-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 28, 25, 0.54);
  backdrop-filter: blur(5px);
  animation: fade-in 140ms ease-out;
}

.modal {
  width: min(780px, 100%);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: 0 28px 90px rgba(12, 27, 24, 0.28);
  animation: modal-in 170ms ease-out;
}

.modal.compact {
  width: min(520px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  min-width: 0;
  flex: 1;
}

.modal-title h2 {
  margin: 0;
  font-family: "Yu Mincho", serif;
  font-size: 1.35rem;
}

.modal-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #52605c;
  background: #f2f2ed;
  font-size: 1.15rem;
}

.icon-button:hover {
  background: #e8e9e4;
}

.modal-body {
  overflow: auto;
  padding: 20px 22px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  background: #fbfaf6;
}

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

.form-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label,
.section-label {
  color: #45524e;
  font-size: 0.72rem;
  font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid #d7d9d3;
  border-radius: 11px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

.form-field input,
.form-field select {
  min-height: 42px;
}

.form-field textarea {
  min-height: 92px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #7ca096;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(32, 116, 95, 0.09);
}

.field-help {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.55;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-field input {
  flex: 1;
}

.detail-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 3px 0 18px;
}

.detail-cover {
  width: 74px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 15px 8px 8px 15px;
  color: #fff;
  background: var(--cover, var(--brand));
  box-shadow:
    inset 6px 0 rgba(255, 255, 255, 0.14),
    0 13px 24px rgba(24, 46, 40, 0.18);
  font-family: "Yu Mincho", serif;
  font-size: 1.6rem;
  font-weight: 800;
}

.detail-main h3 {
  margin: 1px 0 8px;
  font-family: "Yu Mincho", serif;
  font-size: 1.3rem;
}

.detail-progress {
  margin: 10px 0 0;
  color: var(--brand);
  font-size: 1.12rem;
  font-weight: 850;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 20px;
}

.detail-item {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  background: #faf9f4;
}

.detail-item span,
.detail-item strong {
  display: block;
}

.detail-item span {
  color: var(--muted);
  font-size: 0.67rem;
}

.detail-item strong {
  margin-top: 5px;
  font-size: 0.83rem;
}

.notes-card,
.sync-card,
.settings-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #faf9f4;
}

.notes-card {
  white-space: pre-wrap;
  font-size: 0.8rem;
  line-height: 1.7;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-size: 0.78rem;
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item small {
  color: var(--muted);
}

.history-item .quick-button {
  min-height: 30px;
}

.settings-stack {
  display: grid;
  gap: 15px;
}

.settings-section h3 {
  margin: 0 0 5px;
  font-size: 0.92rem;
}

.settings-section > p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.65;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.drop-zone {
  border: 2px dashed #bdc8c4;
  border-radius: 15px;
  padding: 22px;
  color: var(--muted);
  background: #f8faf8;
  text-align: center;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--ready);
  color: var(--brand);
  background: #eff7f4;
}

.drop-zone input {
  display: none;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  padding: 12px 15px;
  color: #fff;
  background: #203d37;
  box-shadow: 0 16px 38px rgba(10, 30, 25, 0.25);
  font-size: 0.78rem;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  background: #7c3831;
}

.spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

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

  .data-table th:nth-child(4),
  .data-table td:nth-child(4),
  .data-table th:nth-child(6),
  .data-table td:nth-child(6) {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 8px;
    margin-bottom: 16px;
  }

  .page-heading {
    min-width: 0;
  }

  .page-heading h1 {
    font-size: 1.4rem;
  }

  .page-heading p {
    display: none;
  }

  .topbar > .primary-button {
    grid-column: 2;
    grid-row: 1;
    width: 42px;
    min-height: 42px;
    overflow: hidden;
    padding: 0;
    white-space: nowrap;
  }

  .topbar > .primary-button .button-label {
    display: none;
  }

  .topbar > .primary-button .button-icon {
    margin: 0;
    font-size: 1.2rem;
  }

  .search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    margin: 0;
  }

  .banner {
    align-items: flex-start;
    padding: 13px;
  }

  .banner > .secondary-button {
    padding: 0 10px;
    font-size: 0.7rem;
  }

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

  .stat-card {
    padding: 13px 14px;
  }

  .stat-value strong {
    font-size: 1.5rem;
  }

  .content-panel {
    border-radius: 17px;
  }

  .panel-toolbar {
    min-height: 58px;
    padding: 10px 12px;
  }

  .result-summary span {
    display: none;
  }

  .select-control {
    max-width: 132px;
  }

  .data-table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
  }

  .work-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    border-top: 1px solid #e8e5dc;
    padding: 14px 13px;
    background: #fffdf8;
  }

  .work-card:first-child {
    border-top: 0;
  }

  .work-card .cover-placeholder {
    width: 34px;
    height: 45px;
  }

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

  .work-card-title {
    width: 100%;
    overflow: hidden;
    border: 0;
    padding: 0;
    color: var(--ink);
    background: transparent;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .work-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 8px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.68rem;
  }

  .work-card-meta .progress-text {
    color: var(--brand);
  }

  .work-card .badge {
    margin-top: 7px;
    padding: 4px 8px;
  }

  .work-card .quick-button {
    align-self: center;
    min-height: 36px;
    padding: 0 10px;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(20, 60, 54, 0.12);
    background: rgba(255, 253, 247, 0.94);
    box-shadow: 0 -10px 30px rgba(23, 43, 38, 0.09);
    backdrop-filter: blur(16px);
  }

  .bottom-nav button {
    display: grid;
    justify-items: center;
    gap: 2px;
    border: 0;
    border-radius: 10px;
    padding: 5px 2px;
    color: #76807c;
    background: transparent;
    font-size: 0.61rem;
  }

  .bottom-nav button.active {
    color: var(--brand);
    background: var(--brand-soft);
    font-weight: 800;
  }

  .bottom-nav .bottom-icon {
    font-size: 1.1rem;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal.compact {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }

  .modal-header {
    padding: 17px 16px 13px;
  }

  .modal-body {
    padding: 17px 16px;
  }

  .modal-footer {
    padding: 12px 16px calc(13px + env(safe-area-inset-bottom));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field.full {
    grid-column: auto;
  }

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

  .history-item {
    grid-template-columns: 1fr auto;
  }

  .history-item .quick-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .toast-region {
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
