/* =====================================================
   司法書士法人ミライ 業務管理システム — Design system v3
   白地 × 黄緑 × 金のアクセント（HPのトーンに準拠）
   ===================================================== */
:root {
  /* 配色は HP（mirai-shihou.com）のスタイルシートの値に準拠 */
  --paper: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --line: #e2e2e2;
  --line-soft: #efefef;
  --line-hard: #cccccc;
  --ink: #333333;
  --ink-2: #545454;
  --ink-3: #767676;
  --brand: #104c2a;      /* 濃緑: 文字のアクセント、ボタン角の三角 */
  --brand-2: #0b3a1f;
  --brand-tint: #e3efca;
  --leaf: #93c133;       /* 黄緑: 塗り・アクセント */
  --leaf-2: #88ac30;
  --leaf-deep: #6f8f22;
  --leaf-ink: #55701a;
  --leaf-bg: #f7f9f0;
  --leaf-tint: #eef5dc;
  --leaf-line: #dceab4;
  --gold-1: #e9db2b; --gold-2: #e19714; --gold-ink: #343022; --gold-corner: #5c3b0e;
  --warn: #855600; --warn-bg: #fff6de; --warn-line: #efd590;
  --bad: #a3302b;  --bad-bg: #fdf0ee;  --bad-line: #efc3be;
  --info: #2a5a86; --info-bg: #edf4fa; --info-line: #c9dcec;
  --r-xs: 4px; --r-sm: 5px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --shadow-1: 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, .09);
  --shadow-3: 0 18px 50px rgba(0, 0, 0, .2);
  --ring: 0 0 0 3px rgba(147, 193, 51, .45);
  --dur-1: .12s; --dur-2: .2s; --dur-3: .34s;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(16px, 2.4vw, 36px);
  --navh: 62px; --barh: 58px; --railw: 236px; --railw-min: 68px;
  --sans: "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", "游ゴシック", "Yu Gothic", "メイリオ", Meiryo, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; font-family: var(--sans); font-weight: 500; font-feature-settings: "palt" 1;
  font-size: .9375rem; line-height: 1.65; letter-spacing: .02em;
  color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); }
.tnum, table, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.boot { padding: 28px; color: var(--ink-3); }
.only-mobile { display: none !important; }
@media (max-width: 759px) { .only-mobile { display: revert !important; } .only-desktop { display: none !important; } }
.print-only { display: none; }

/* ===== Shell ===== */
.app-shell { display: flex; min-height: 100vh; }
.app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--navh) + env(safe-area-inset-bottom) + 12px); }
.shell { width: 100%; max-width: 1560px; margin-inline: auto; padding-inline: var(--gutter); }
.page-main { padding-block: 26px 40px; flex: 1; }
.page-main:focus { outline: none; box-shadow: none; }
.view.is-enter { animation: viewIn var(--dur-3) var(--ease-out); }
@media (min-width: 1024px) { .app-body { padding-bottom: 0; } .botnav { display: none !important; } }

/* Rail */
.rail {
  display: none; position: sticky; top: 0; align-self: flex-start; width: var(--railw); height: 100dvh; flex: none; flex-direction: column;
  background: var(--surface); color: var(--ink); border-right: 1px solid var(--line); transition: width var(--dur-2) var(--ease-out);
}
@media (min-width: 1024px) { .rail { display: flex; } .only-rail-off { display: none !important; } }
.rail.is-min { width: var(--railw-min); }
.rail-brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; height: 86px; flex: none; padding-inline: 18px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; color: inherit; text-align: left; width: 100%; }
.rail-logo { display: block; width: 181px; height: 40px; }
.rail-mark { display: none; width: 34px; height: 34px; }
.rail-sub { font-size: .6875rem; font-weight: 700; color: var(--leaf-ink); letter-spacing: .16em; white-space: nowrap; line-height: 1.3; padding-left: 2px; }
.rail.is-min .rail-logo, .rail.is-min .rail-sub, .rail.is-min .rail-item span, .rail.is-min .rail-sec { display: none; }
.rail.is-min .rail-mark { display: block; }
.rail.is-min .rail-brand { align-items: center; padding-inline: 0; }
.rail-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; scrollbar-color: var(--line-hard) transparent; }
.rail-sec { font-size: .6875rem; letter-spacing: .12em; color: var(--ink-3); padding: 12px 12px 4px; font-weight: 700; }
.rail.is-min .rail-nav { padding-top: 8px; }
.rail-item {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 35px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: none;
  color: var(--ink-2); font-weight: 500; font-size: .875rem; text-align: left; width: 100%; white-space: nowrap; transition: background var(--dur-1), color var(--dur-1);
}
.rail-item i { width: 18px; text-align: center; font-size: .875rem; flex: none; color: var(--leaf-2); }
.rail-item:hover { background: var(--paper); color: var(--ink); }
.rail-item.is-on { background: var(--leaf-tint); color: var(--brand); font-weight: 700; }
.rail-item.is-on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--leaf); }
.rail-item.is-on i { color: var(--leaf-deep); }
.rail.is-min .rail-item { justify-content: center; padding-inline: 0; }
.rail-foot { padding: 10px 12px 14px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-offices { font-size: .6875rem; color: var(--ink-3); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail.is-min .rail-offices { display: none; }
.rail.is-min .rail-foot { justify-content: center; }
.rail-tool { border: 0; background: none; color: var(--ink-3); width: 34px; height: 34px; border-radius: var(--r-sm); flex: none; }
.rail-tool:hover { background: var(--paper); color: var(--ink); }

/* Appbar */
.appbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.appbar-row { height: var(--barh); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-brand { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: none; padding: 0; flex: none; }
.bar-brand img { width: 30px; height: 30px; display: block; }
.crumb { color: var(--ink-3); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--ink); font-weight: 600; font-size: .9375rem; margin-left: 2px; }
.crumb .sep { margin-inline: 6px; opacity: .6; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.search-btn { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 10px 0 12px; border-radius: 999px; border: 1px solid var(--line-hard); background: var(--surface); color: var(--ink-3); font-size: .8125rem; min-width: 210px; }
.search-btn:hover { border-color: var(--ink-3); color: var(--ink-2); }
.search-btn span { flex: 1; text-align: left; }
kbd { font: 600 .6875rem/1 var(--sans); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-hard); background: var(--surface-2); color: var(--ink-3); }
.bar-select { min-height: 36px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid var(--line-hard); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2378857c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; font-size: .8125rem; font-weight: 600; color: var(--ink-2); max-width: 150px; }
.bar-select.is-set { border-color: var(--leaf-2); color: var(--brand); background-color: var(--leaf-tint); }
.actor-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 4px; border-radius: 999px; border: 1px solid var(--line-hard); background: var(--surface); font-size: .8125rem; font-weight: 600; color: var(--ink-2); max-width: 170px; }
.actor-btn:hover { border-color: var(--ink-3); }
.actor-btn .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actor-btn.is-empty { border-style: dashed; color: var(--ink-3); padding-left: 12px; }
.avatar { width: 28px; height: 28px; border-radius: 999px; display: inline-grid; place-items: center; font-weight: 700; font-size: .8125rem; color: var(--brand); background: var(--leaf-bg); border: 1px solid var(--leaf-line); flex: none; }
.avatar-lg { width: 38px; height: 38px; font-size: 1rem; }
.icon-btn { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line-hard); background: var(--surface); color: var(--ink-2); display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; opacity: 0; transition: opacity var(--dur-2); }
.progress::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--leaf); animation: slide 1s linear infinite; }
.progress.is-on { opacity: 1; }
@media (max-width: 759px) {
  .search-btn { min-width: 0; width: 36px; padding: 0; justify-content: center; } .search-btn span, .search-btn kbd { display: none; }
  .actor-btn .nm { display: none; } .actor-btn { padding: 0 3px; border: 0; background: none; } .actor-btn.is-empty { padding: 0; width: 36px; justify-content: center; border: 1px dashed var(--line-hard); }
  .crumb .pre, .crumb .sep { display: none; } .bar-select { max-width: 112px; padding-left: 10px; }
}

/* Bottom nav */
.botnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.botnav-btn { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--navh); border: 0; background: none; font-size: .6875rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); }
.botnav-btn i { font-size: 1.05rem; }
.botnav-btn.is-on { color: var(--brand); }
.botnav-btn.is-on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--leaf); }

/* ===== Page scaffolding ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.3125rem, 1.1rem + .7vw, 1.625rem); font-weight: 700; letter-spacing: .08em; line-height: 1.35; display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.page-head h1 .en { font-family: Arial, Helvetica, sans-serif; font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--leaf-ink); }
.page-head p { margin-top: 4px; color: var(--ink-3); font-size: .875rem; max-width: 62ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 600; letter-spacing: .1em; color: var(--leaf-ink); margin-bottom: 4px; }
.eyebrow::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--leaf); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(16px, 1.8vw, 22px); box-shadow: var(--shadow-1); }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-flush > .card-head { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.card-title { font-size: .9375rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-title i { color: var(--leaf-ink); font-size: .8125rem; width: 30px; height: 30px; border-radius: 999px; background: linear-gradient(135deg, #eef5dc, #dceab4); display: inline-grid; place-items: center; flex: none; }
.card-note { font-size: .8125rem; color: var(--ink-3); margin-top: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-main { grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.stack { display: grid; gap: 16px; align-content: start; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-weight: 700; font-size: 1rem; }
.sec-title:first-child { margin-top: 0; }
.sec-title > i { color: var(--leaf-ink); }
.sec-title .cnt { font-size: .75rem; padding: 1px 9px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-weight: 700; }
.spacer { flex: 1; }

/* ===== Controls ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border-radius: var(--r-sm); border: 1px solid var(--line-hard); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .875rem; white-space: nowrap; transition: background var(--dur-1), border-color var(--dur-1), transform var(--dur-1); }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn i { font-size: .8125rem; }
a.btn { text-decoration: none; }
.btn-primary, .btn-cta { position: relative; overflow: hidden; font-weight: 700; }
.btn-primary::after, .btn-cta::after { content: ""; position: absolute; right: 0; bottom: 0; border: 5px solid transparent; border-right-color: var(--brand); border-bottom-color: var(--brand); }
.btn-primary { background: var(--leaf); border-color: var(--leaf); color: var(--brand); }
.btn-primary:hover { background: var(--leaf-2); border-color: var(--leaf-2); }
.btn-cta { min-height: 44px; padding: 0 22px; border: 0; background: linear-gradient(125deg, var(--gold-1) 0%, var(--gold-2) 100%); color: var(--gold-ink); font-size: .9375rem; }
.btn-cta::after { border-width: 6px; border-right-color: var(--gold-corner); border-bottom-color: var(--gold-corner); }
.btn-cta:hover { background: linear-gradient(125deg, var(--gold-1) 0%, var(--gold-2) 100%); filter: brightness(.95); }
.btn-danger { border-color: var(--bad-line); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-fill:hover { background: #8a2622; border-color: #8a2622; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-soft); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: .8125rem; }
.btn-icon { width: 38px; padding: 0; } .btn-sm.btn-icon { width: 32px; }
.field { min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-hard); background: var(--surface); font-size: .9375rem; width: 100%; max-width: 100%; min-width: 0; outline: none; transition: box-shadow var(--dur-1), border-color var(--dur-1); }
.field::placeholder { color: #a3ada6; }
.field:hover { border-color: var(--ink-3); }
.field:focus { border-color: var(--leaf-2); box-shadow: var(--ring); }
select.field { appearance: none; padding-right: 32px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2378857c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
textarea.field { padding: 9px 12px; min-height: 84px; resize: vertical; line-height: 1.6; }
.field-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-row > label, .field-label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.req { font-size: .6875rem; font-weight: 700; color: var(--bad); background: var(--bad-bg); border-radius: 4px; padding: 0 5px; line-height: 1.6; }
.hint { font-size: .75rem; color: var(--ink-3); line-height: 1.5; }
.form-grid { display: grid; gap: 14px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.form-sec { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--leaf-ink); margin-top: 8px; }
.form-sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.inline-add { display: flex; gap: 6px; } .inline-add .field { flex: 1; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .field { min-height: 38px; width: auto; }
.search-field { position: relative; flex: 1; min-width: 200px; }
.search-field i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .8125rem; pointer-events: none; }
.search-field .field { width: 100%; padding-left: 36px; border-radius: 999px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #e6e6e6; border-radius: 999px; }
.seg button { border: 0; background: none; min-height: 32px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: .8125rem; color: var(--ink-3); }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); }
.date-nav { display: inline-flex; align-items: center; gap: 4px; }
.date-nav .field { width: 158px; }
.date-nav .field[type="month"] { width: 190px; }
.result-count { font-size: .8125rem; color: var(--ink-3); margin-top: 12px; }

/* Chips / marks */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); line-height: 1.5; }
.chip-soft { background: var(--line-soft); border-color: transparent; }
.chip-brand { background: var(--brand-tint); color: var(--brand); border-color: transparent; }
.chip-leaf { background: var(--leaf-bg); color: var(--leaf-ink); border-color: var(--leaf-line); }
.chip-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.chip-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.chip-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.flag { display: inline-grid; place-items: center; width: 34px; height: 30px; border-radius: var(--r-xs); border: 1px solid var(--line-hard); background: var(--surface); color: #aab3ac; font-weight: 700; font-size: .875rem; transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1), transform var(--dur-1); user-select: none; padding: 0; }
.flag:hover { border-color: var(--leaf-deep); color: var(--brand); }
.flag:active { transform: scale(.94); }
.flag.is-on { background: var(--leaf); border-color: var(--leaf-2); color: var(--brand); }
.check-pill { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-hard); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .8125rem; width: 100%; transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1); }
.check-pill::before { content: ""; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line-hard); flex: none; background: var(--surface) center / 10px no-repeat; }
.check-pill:hover { border-color: var(--leaf-deep); }
.check-pill.is-on { background: var(--leaf-tint); border-color: var(--leaf-2); color: var(--brand); }
.check-pill.is-on::before { border-color: var(--leaf-2); background-color: var(--leaf); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.2l2.6 2.6L10 3.4' fill='none' stroke='%23104c2a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.check-group { grid-column: 1 / -1; }
.check-group > .field-label { margin-bottom: 7px; }

/* ===== Table ===== */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { border-collapse: separate; border-spacing: 0; font-size: .875rem; width: 100%; min-width: 760px; }
.tbl th, .tbl td { padding: 9px 11px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; white-space: nowrap; }
.tbl thead th { background: var(--paper); color: var(--ink-2); font-weight: 700; font-size: .75rem; letter-spacing: .04em; border-bottom-color: var(--line); }
.tbl thead th.grp { text-align: center; color: var(--brand); background: var(--brand-tint); border-left: 1px solid var(--leaf-line); }
.tbl thead th.sub { text-align: center; background: var(--brand-tint); color: var(--brand); padding-inline: 6px; }
.tbl td.c, .tbl th.c { text-align: center; padding-inline: 6px; }
.tbl td.grp-first, .tbl th.grp-first { border-left: 1px solid var(--line); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--dur-1); }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr.is-done td { color: var(--ink-3); }
.tbl tbody tr.is-done .row-link { color: var(--ink-3); }
.tbl td.wrap { white-space: normal; min-width: 170px; max-width: 260px; }
.tbl td.note { white-space: normal; min-width: 140px; max-width: 220px; color: var(--ink-2); font-size: .8125rem; }
.tbl td.main { white-space: normal; min-width: 160px; max-width: 300px; }
.cell-sub { display: block; font-size: .75rem; color: var(--ink-3); white-space: normal; line-height: 1.45; margin-top: 1px; font-weight: 400; }
.tbl .no { color: var(--ink-3); font-weight: 600; width: 40px; text-align: right; }
.tbl .time { font-weight: 700; }
.row-link { color: var(--ink); font-weight: 600; background: none; border: 0; padding: 0; text-align: left; border-radius: 4px; }
.row-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; font-size: .9375rem; color: var(--ink-3); }
.empty > i { font-size: 1.25rem; color: var(--leaf-ink); width: 48px; height: 48px; border-radius: 999px; background: linear-gradient(135deg, #eef5dc, #dceab4); display: grid; place-items: center; }
.empty b { color: var(--ink-2); font-weight: 600; }
.empty small { font-size: .8125rem; max-width: 46ch; }
.empty .btn { margin-top: 6px; }
.empty-sm { padding: 22px 12px; font-size: .875rem; }

/* Mobile cards (チェック表のスマホ表示) */
.mcards { display: grid; gap: 10px; padding: 12px; }
.mcard { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.mcard.is-done { background: var(--surface-2); }
.mcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mcard-title { font-weight: 700; font-size: .9375rem; }
.mcard-when { font-size: .8125rem; font-weight: 700; color: var(--brand); }
.mcard-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .8125rem; color: var(--ink-2); margin-top: 4px; }
.mcard-meta i { color: var(--ink-3); margin-right: 4px; font-size: .75rem; }
.mcard-checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.mcard-checks > div { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .6875rem; color: var(--ink-3); }
.mcard-checks .flag { width: 100%; height: 34px; }

/* ===== Case list (進捗ステップ型) ===== */
.case-list { display: grid; }
.case-row { display: grid; gap: 12px 20px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); grid-template-columns: 1fr; align-items: center; transition: background var(--dur-1); }
.case-row:last-child { border-bottom: 0; }
.case-row:hover { background: var(--surface-2); }
.case-row.is-done { opacity: .72; }
@media (min-width: 1180px) { .case-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 188px; } }
.case-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-title .row-link { font-size: 1rem; }
.case-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: .8125rem; color: var(--ink-2); margin-top: 4px; }
.case-meta i { color: var(--ink-3); margin-right: 5px; font-size: .75rem; }
.case-note { font-size: .8125rem; color: var(--ink-3); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.case-progress { min-width: 0; }
.case-progress-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.case-side { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
@media (min-width: 1180px) { .case-side { flex-direction: column; align-items: flex-end; gap: 8px; } }
.due { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.due small { font-size: .6875rem; color: var(--ink-3); letter-spacing: .04em; }
@media (min-width: 1180px) { .due { align-items: flex-end; } }
.stepper { display: grid; gap: 4px; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
@media (min-width: 1180px) { .stepper[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stepper[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .stepper[data-n="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.step { min-width: 0; min-height: 30px; padding: 0 4px; border-radius: 6px; border: 1px solid var(--line-hard); background: var(--surface); font-size: .6875rem; font-weight: 600; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1); }
.step:hover { border-color: var(--leaf-deep); color: var(--brand); }
.step.is-on { background: var(--leaf); border-color: var(--leaf-2); color: var(--brand); }
.step.is-next:not(.is-on) { border: 1px dashed var(--leaf-2); background: var(--leaf-bg); color: var(--leaf-ink); }
.stepper-lg { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stepper-lg .step { min-height: 42px; font-size: .8125rem; border-radius: var(--r-sm); display: flex; align-items: center; gap: 8px; padding: 0 10px; text-align: left; }
.stepper-lg .step b { width: 20px; height: 20px; border-radius: 999px; background: var(--line-soft); color: var(--ink-3); display: inline-grid; place-items: center; font-size: .6875rem; flex: none; }
.stepper-lg .step.is-on b { background: rgba(255,255,255,.6); color: var(--brand); }
.bar { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; flex: 1; min-width: 40px; }
.bar > i { display: block; height: 100%; background: var(--leaf); border-radius: 999px; transition: width var(--dur-3) var(--ease-out); }
.step-counter { font-size: .8125rem; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.step-next { font-size: .75rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-next b { color: var(--leaf-ink); font-weight: 600; }
.done-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-hard); background: var(--surface); font-size: .75rem; font-weight: 600; color: var(--ink-2); }
.done-toggle:hover { border-color: var(--leaf-deep); color: var(--brand); }
.done-toggle.is-on { background: var(--leaf); border-color: var(--leaf-2); color: var(--brand); }

/* ===== Home ===== */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.hero h1 { font-weight: 700; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); letter-spacing: .08em; line-height: 1.35; }
.hero h1 small { font-family: var(--sans); font-size: .9375rem; font-weight: 500; color: var(--ink-3); margin-left: 10px; letter-spacing: .02em; }
.hero p { color: var(--ink-3); font-size: .875rem; margin-top: 4px; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats-6 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stats-6 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1240px) { .stats-6 { grid-template-columns: repeat(6, 1fr); } }
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 17px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-align: left; box-shadow: var(--shadow-1); transition: border-color var(--dur-2), transform var(--dur-2), box-shadow var(--dur-2); }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #88ac30, #b6d45e); }
.stat.is-bad::before { background: var(--bad); }
.stat.is-warn::before { background: var(--gold-2); }
button.stat:hover { border-color: var(--leaf-2); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.stat-label { font-size: .8125rem; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.stat-label i { color: var(--leaf-ink); font-size: .8125rem; }
.stat-num { font-size: 1.875rem; font-weight: 700; line-height: 1.2; letter-spacing: 0; }
.stat-num small { font-size: .8125rem; color: var(--ink-3); font-weight: 500; margin-left: 3px; }
.stat-sub { font-size: .75rem; color: var(--ink-3); }
.stat.is-bad { border-color: var(--bad-line); background: var(--bad-bg); } .stat.is-bad .stat-num, .stat.is-bad .stat-label i { color: var(--bad); }
.stat.is-warn { border-color: var(--warn-line); background: var(--warn-bg); } .stat.is-warn .stat-num, .stat.is-warn .stat-label i { color: var(--warn); }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); width: 100%; }
.agenda li:last-child { border-bottom: 0; }
.agenda .t { font-weight: 700; font-size: .9375rem; }
.agenda .t.none { color: var(--ink-3); font-weight: 500; font-size: .75rem; }
.agenda .b { min-width: 0; }
.agenda .b small { display: block; font-size: .8125rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda .s { display: flex; align-items: center; gap: 6px; }
.agenda li.is-done .row-link, .agenda li.is-done .t { color: var(--ink-3); }
.todo-group + .todo-group { border-top: 1px solid var(--line-soft); }
.todo-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px 4px; font-size: .8125rem; font-weight: 700; }
.todo-head .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--warn); }
.todo-head.is-bad .dot { background: var(--bad); }
.todo-head .n { margin-left: auto; font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.todo-list { list-style: none; margin: 0; padding: 0 8px 8px; }
.todo-list li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); }
.todo-list li:hover { background: var(--surface-2); }
.todo-list .b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .875rem; }
.todo-list .b small { color: var(--ink-3); margin-left: 6px; }
.todo-more { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--ink-3); padding: 0 18px 10px; }
.areas { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.area { display: flex; flex-direction: column; gap: 3px; padding: 14px 15px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color var(--dur-2), background var(--dur-2); }
.area:hover { border-color: var(--leaf-2); background: var(--leaf-bg); }
.area-icon { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; background: linear-gradient(135deg, #eef5dc, #dceab4); color: var(--leaf-ink); font-size: .875rem; margin-bottom: 6px; }
.area-name { font-weight: 700; font-size: .875rem; }
.area-num { font-size: .8125rem; color: var(--ink-3); }
.area-num b { font-size: 1.125rem; color: var(--ink); margin-right: 2px; }
.notice { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: var(--r); background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info); font-size: .875rem; margin-bottom: 16px; flex-wrap: wrap; }
.notice .btn { margin-left: auto; }
.notice.is-plain { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }

/* Staff board */
.board { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.board-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.board-head h2 { font-size: 1rem; font-weight: 700; flex: 1; }
.board-list { list-style: none; margin: 0; padding: 6px; }
.board-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: .875rem; }
.board-list li:hover { background: var(--surface-2); }
.board-list .t { min-width: 0; }
.board-list .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-list .t small { display: block; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .75rem; }
.board-list .d { font-size: .75rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-size: .75rem; color: var(--ink-3); font-weight: 600; padding: 2px 0 6px; }
.cal .day { min-height: 92px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 6px 7px; background: var(--surface); font-size: .75rem; display: flex; flex-direction: column; gap: 3px; text-align: left; align-items: flex-start; transition: border-color var(--dur-1), background var(--dur-1); }
button.day:hover { border-color: var(--leaf-2); background: var(--leaf-bg); }
.cal .day.is-out { background: transparent; border-color: transparent; }
.cal .day.is-today { border-color: var(--leaf-2); box-shadow: inset 0 0 0 1px var(--leaf-2); background: var(--leaf-tint); }
.cal .day .dn { font-weight: 700; color: var(--ink-2); font-size: .8125rem; }
.cal .day.is-today .dn { color: var(--brand); }
.cal .sun .dn, .cal .dow.sun { color: var(--bad); } .cal .sat .dn, .cal .dow.sat { color: var(--info); }
.cal .ev { font-size: .6875rem; font-weight: 600; padding: 0 6px; border-radius: 4px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.7; }
.ev-s { background: var(--brand-tint); color: var(--brand); } .ev-e { background: var(--info-bg); color: var(--info); } .ev-d { background: var(--warn-bg); color: var(--warn); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .75rem; color: var(--ink-2); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
@media (max-width: 759px) { .cal { gap: 3px; } .cal .day { min-height: 64px; padding: 4px; } .cal .ev { padding: 0 3px; font-size: .625rem; } }

/* Rank rows / fees */
.rank { display: grid; grid-template-columns: minmax(84px, auto) 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: .875rem; }
.rank:last-child { border-bottom: 0; }
.fee-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.fee-table th, .fee-table td { padding: 9px 4px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; font-weight: 500; }
.fee-table tr:last-child th, .fee-table tr:last-child td { border-bottom: 0; }
.fee-table td { text-align: right; white-space: nowrap; font-weight: 700; }
.fee-table small { display: block; font-weight: 400; color: var(--ink-3); font-size: .75rem; white-space: normal; }
.calc-out { margin-top: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--leaf-bg); border: 1px solid var(--leaf-line); }
.calc-out .v { font-size: 1.5rem; font-weight: 700; color: var(--brand); line-height: 1.3; }
.calc-out .f { font-size: .8125rem; color: var(--leaf-ink); }
.terms { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.terms li { display: flex; justify-content: space-between; gap: 12px; font-size: .8125rem; padding: 7px 11px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-soft); }
.terms li b { font-weight: 700; white-space: nowrap; }
.terms li.is-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.terms li.is-bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }

/* ===== Layers: drawer / dialog / palette ===== */
.layer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .38); animation: fadeIn var(--dur-2) var(--ease-out); }
.drawer-bg { display: flex; justify-content: flex-end; align-items: flex-end; }
.drawer { width: 100%; max-width: 640px; height: 94dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3); animation: sheetIn var(--dur-3) var(--ease-out); }
@media (min-width: 760px) { .drawer-bg { align-items: stretch; } .drawer { height: 100dvh; border-radius: 0; animation-name: drawerIn; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-head h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: .06em; }
.drawer-head p { font-size: .8125rem; color: var(--ink-3); margin-top: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 26px; overscroll-behavior: contain; }
.drawer-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-2); flex: none; }
.drawer-foot .grp { display: flex; gap: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 18px; }
.tabs button { border: 0; background: none; padding: 9px 12px; font-weight: 600; font-size: .875rem; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; }
.tabs button:hover { color: var(--ink); }
.tabs button.is-on { color: var(--brand); border-bottom: 3px solid var(--leaf); }
.dialog-bg { z-index: 70; display: grid; place-items: center; padding: 20px; }
.dialog { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 22px; animation: popIn var(--dur-2) var(--ease-out); }
.dialog h2 { font-size: 1.0625rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.dialog h2 i { width: 34px; height: 34px; border-radius: 999px; display: inline-grid; place-items: center; background: linear-gradient(135deg, #eef5dc, #dceab4); color: var(--leaf-ink); font-size: .875rem; flex: none; }
.dialog.is-danger h2 i { background: var(--bad-bg); color: var(--bad); }
.dialog-body { margin-top: 10px; color: var(--ink-2); font-size: .9375rem; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.name-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.name-chips button { min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-hard); background: var(--surface); font-size: .8125rem; font-weight: 600; }
.name-chips button:hover, .name-chips button.is-on { border-color: var(--leaf-2); background: var(--leaf-tint); color: var(--brand); }
.palette-bg { z-index: 65; display: flex; justify-content: center; align-items: flex-start; padding: min(12vh, 110px) 16px 16px; }
.palette { width: 100%; max-width: 620px; max-height: 76dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); overflow: hidden; animation: popIn var(--dur-2) var(--ease-out); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.palette-input i { color: var(--ink-3); }
.palette-input input { flex: 1; min-height: 54px; border: 0; outline: none; background: none; font-size: 1rem; min-width: 0; }
.palette-input input:focus-visible { box-shadow: none; }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-sec { font-size: .6875rem; font-weight: 700; letter-spacing: .1em; color: var(--ink-3); padding: 10px 12px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: var(--r-sm); text-align: left; font-size: .875rem; }
.palette-item .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--line-soft); color: var(--ink-2); display: grid; place-items: center; font-size: .8125rem; flex: none; }
.palette-item .b { flex: 1; min-width: 0; }
.palette-item .b b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .b small { display: block; color: var(--ink-3); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item.is-active, .palette-item:hover { background: var(--leaf-tint); }
.palette-item.is-active .ic { background: var(--leaf); color: var(--brand); }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--ink-3); background: var(--surface-2); flex: none; }
.menu-sheet { display: grid; gap: 4px; }
.sheet-logo { display: block; width: 181px; height: 40px; margin-bottom: 4px; }
.menu-sheet .rail-sec { color: var(--ink-3); padding: 12px 4px 4px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.menu-grid button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: .875rem; font-weight: 600; text-align: left; }
.menu-grid button i { color: var(--leaf-deep); width: 18px; text-align: center; }
.menu-grid button.is-on { border-color: var(--leaf-2); background: var(--leaf-tint); color: var(--brand); }

/* History timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 26px 1fr; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: .875rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline li > div { min-width: 0; }
.card-flush .timeline li { padding-inline: 18px; }
.timeline .ic { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-size: .6875rem; color: var(--ink-3); background: var(--line-soft); margin-top: 1px; }
.timeline .ic.memo { background: var(--leaf); color: var(--brand); }
.timeline .ic.created { background: var(--leaf-bg); color: var(--leaf-ink); }
.timeline .ic.deleted { background: var(--bad-bg); color: var(--bad); }
.timeline .meta { display: flex; gap: 4px 8px; align-items: center; flex-wrap: wrap; color: var(--ink-3); font-size: .75rem; margin-bottom: 2px; }
.timeline .meta b { color: var(--ink-2); font-weight: 600; }
.timeline .body { white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.timeline .del { margin-left: auto; border: 0; background: none; color: var(--ink-3); font-size: .75rem; padding: 2px 6px; border-radius: 4px; }
.timeline .del:hover { color: var(--bad); background: var(--bad-bg); }
.memo-box { display: grid; gap: 8px; margin-bottom: 16px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.memo-box .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Toast */
.toast { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--navh) + env(safe-area-inset-bottom) + 16px); max-width: calc(100% - 32px); display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .875rem; font-weight: 500; box-shadow: var(--shadow-2); animation: toastIn var(--dur-2) var(--ease-out); }
.toast i { color: #c9e58a; }
.toast.is-bad { background: var(--bad); } .toast.is-bad i { color: #fff; }
@media (min-width: 1024px) { .toast { bottom: 28px; } }

/* Master page */
.master-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.master-list li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: .875rem; font-weight: 600; }
.master-list li button { border: 0; background: none; color: var(--ink-3); width: 26px; height: 26px; border-radius: 999px; font-size: .75rem; }
.master-list li button:hover { background: var(--bad-bg); color: var(--bad); }
.master-list .none { border: 0; background: none; color: var(--ink-3); font-weight: 400; padding-left: 0; }
.add-row { display: flex; gap: 8px; margin-top: 14px; }
.add-row .field { flex: 1; }
.office-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.office-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-size: .8125rem; color: var(--ink-2); }
.office-list b { font-size: .9375rem; color: var(--ink); }
.office-list .del { grid-row: span 2; align-self: start; }

/* Skeleton */
.skel { display: grid; gap: 14px; }
.skel i { display: block; height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--line-soft) 25%, #fafafa 50%, var(--line-soft) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel .h1 { height: 34px; width: min(320px, 60%); } .skel .blk { height: 160px; border-radius: var(--r-lg); } .skel .row { height: 74px; border-radius: var(--r-lg); }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes sheetIn { from { transform: translateY(32px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes popIn { from { transform: translateY(8px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0 } to { transform: translate(-50%, 0); opacity: 1 } }
@keyframes slide { from { transform: translateX(-100%) } to { transform: translateX(250%) } }
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Print */
@media print {
  body { background: #fff; font-size: 10.5pt; }
  .rail, .appbar, .botnav, .toolbar, .page-actions, .no-print, .toast { display: none !important; }
  .app-body { padding: 0; } .page-main { padding: 0; } .shell { padding: 0; max-width: none; }
  .card { border-color: #999; box-shadow: none; border-radius: 0; }
  .only-mobile { display: none !important; } .only-desktop { display: revert !important; }
  .tbl { min-width: 0 !important; font-size: 9.5pt; } .tbl th, .tbl td { padding: 5px 6px; border-color: #bbb; }
  .flag { border-color: #777; }
  .flag.is-on { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only { display: block; font-size: 13pt; margin-bottom: 8px; }
  body[data-screen="daily"] .page-head { display: none !important; }
  .view.is-enter { animation: none; }
}
