/* ============================================================
   ポップ & ニューモーフィズム風デザイン
   - 背景と同色の面に「明るい影(左上)＋暗い影(右下)」で凸/凹を表現
   - 差し色はカラフルなグラデーション。角は大きく丸く
   ============================================================ */
:root {
  --bg: #e8ecf6;
  --surface: #e8ecf6;
  --surface-2: #dde2f0;
  --text: #29304d;
  --muted: #687090;
  --border: rgba(110, 122, 165, .22);

  --accent: #5d4de6;
  --accent-rgb: 93, 77, 230;
  --accent-text: #ffffff;
  --grad: linear-gradient(135deg, #7a6bff 0%, #b15cf2 55%, #ff7eb3 100%);
  --grad-ok: linear-gradient(90deg, #1fd3a2, #39a7ff);

  --c-yellow: #ffb62e; --c-pink: #ff6f9f; --c-mint: #1fcf9c; --c-sky: #39a7ff; --c-violet: #7a6bff;
  --series2: #14b8a6;
  --danger: #e0393e;
  --ok: #0fa57b;
  --warn-bg: #ffecb8; --warn-text: #7a5300;
  --miss-bg: #ffd3da; --off-bg: #d3d8e8;

  --sh-hi: rgba(255, 255, 255, .95);
  --sh-lo: rgba(146, 158, 196, .55);
  --raised: 8px 8px 18px var(--sh-lo), -8px -8px 18px var(--sh-hi);
  --raised-sm: 4px 4px 10px var(--sh-lo), -4px -4px 10px var(--sh-hi);
  --raised-xs: 2px 2px 6px var(--sh-lo), -2px -2px 6px var(--sh-hi);
  --inset: inset 3px 3px 7px var(--sh-lo), inset -3px -3px 7px var(--sh-hi);
  --inset-sm: inset 2px 2px 5px var(--sh-lo), inset -2px -2px 5px var(--sh-hi);
  --radius: 22px;
  --radius-sm: 14px;
  --topbar: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f2336; --surface: #1f2336; --surface-2: #181b2b; --text: #eceffb; --muted: #a0a8c8;
    --border: rgba(160, 170, 220, .16);
    --accent: #a094ff; --accent-rgb: 160, 148, 255; --accent-text: #ffffff;
    --danger: #ff7b80; --ok: #3fdba8;
    --warn-bg: #4a3a12; --warn-text: #ffd978; --miss-bg: #4d2530; --off-bg: #2a2e44;
    --sh-hi: rgba(72, 82, 128, .38); --sh-lo: rgba(8, 10, 22, .7);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.55 "BIZ UDPGothic", "Yu Gothic UI", "Hiragino Maru Gothic ProN", "Meiryo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: .01em; }
h2 { font-size: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------- レイアウト ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: var(--topbar); background: var(--surface); box-shadow: 0 6px 16px var(--sh-lo), 0 -2px 0 var(--sh-hi);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; white-space: nowrap; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 12px; background: var(--grad); display: grid; place-items: center;
  box-shadow: 3px 3px 8px var(--sh-lo), -3px -3px 8px var(--sh-hi);
}
.brand-mark svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.tabs-nav { display: flex; gap: 8px; align-items: center; }
.tabs-nav a {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; color: var(--muted);
  text-decoration: none; font-weight: 700; transition: box-shadow .15s, color .15s;
}
.tabs-nav a:hover { color: var(--text); box-shadow: var(--raised-sm); }
.tabs-nav a.on { color: var(--accent); box-shadow: var(--inset); }
.tabs-nav .ico { font-size: 15px; }
.spacer { flex: 1; }
.usermenu { position: relative; }
.usermenu summary {
  list-style: none; cursor: pointer; padding: 5px 14px 5px 6px; border-radius: 999px; display: flex; gap: 8px; align-items: center;
  box-shadow: var(--raised-sm); font-weight: 700;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu[open] summary { box-shadow: var(--inset); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.usermenu .pop {
  position: absolute; right: 0; top: 48px; min-width: 200px; background: var(--surface); border-radius: 18px; box-shadow: var(--raised); padding: 8px;
}
.usermenu .pop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.usermenu .pop button:hover { box-shadow: var(--inset-sm); }
.page { max-width: 1560px; margin: 0 auto; padding: 22px 24px 28px; display: grid; gap: 18px; }
.page > * { min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--raised); }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }

/* ---------------- ボタン・入力 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--surface); box-shadow: var(--raised-sm); cursor: pointer; font-weight: 800; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; box-shadow: var(--inset); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--raised-xs); }
.btn.primary {
  background: var(--grad); color: #fff; text-shadow: 0 1px 1px rgba(60, 20, 120, .25);
  box-shadow: 0 8px 16px rgba(var(--accent-rgb), .35), -3px -3px 8px var(--sh-hi);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:active { box-shadow: inset 2px 3px 8px rgba(40, 20, 120, .35); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; box-shadow: var(--raised-xs); }
.btn.icon { width: 38px; padding: 0; font-size: 18px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--inset); outline: none;
}
select { cursor: pointer; }
textarea { height: auto; padding: 10px 14px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { box-shadow: var(--inset), 0 0 0 3px rgba(var(--accent-rgb), .35); }
input:disabled, select:disabled { opacity: .55; }
.btn:focus-visible { outline: 3px solid rgba(var(--accent-rgb), .45); outline-offset: 2px; }
label { font-size: 12px; font-weight: 800; color: var(--muted); display: block; margin: 0 0 5px 4px; }
.field { min-width: 0; }
.field .req { color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.help { font-size: 12px; color: var(--muted); margin: 5px 0 0 4px; }
.form-error { background: var(--miss-bg); color: var(--danger); border-radius: var(--radius-sm); padding: 9px 14px; font-size: 13px; font-weight: 600; }
.notice { background: var(--warn-bg); color: var(--warn-text); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 18px 16px; }
.chip {
  border: 0; background: var(--surface); box-shadow: var(--raised-xs); border-radius: 999px; padding: 4px 13px; font-size: 12px; font-weight: 700; cursor: pointer;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { color: var(--accent); transform: translateY(-1px); }
.chip:active { box-shadow: var(--inset-sm); transform: none; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; box-shadow: var(--inset-sm); font-size: 11.5px; font-weight: 800; color: var(--muted); }
.badge.ok { color: var(--ok); }
.badge.off { opacity: .7; }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); box-shadow: none; }
.badge.danger { background: var(--miss-bg); color: var(--danger); box-shadow: none; }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); font-weight: 600; }

/* ---------------- 工数入力: ダッシュボード ---------------- */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 12px 18px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.bubble {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px;
  box-shadow: var(--raised-xs); background: var(--surface);
}
.kpi-big { font-size: 28px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-big small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.kpi-sub { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.kpi-sub b { color: var(--text); }
.kpi.span3 { grid-column: span 3; } .kpi.span2 { grid-column: span 2; } .kpi.span4 { grid-column: span 4; }
.kpi.span5 { grid-column: span 5; } .kpi.span3b { grid-column: span 3; }
.meter { height: 10px; border-radius: 999px; box-shadow: var(--inset-sm); overflow: hidden; margin: 5px 0 2px; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--grad-ok); min-width: 0; transition: width .5s; }
.meter.warn > i { background: linear-gradient(90deg, #ffb62e, #ff8a4c); }
.mini { display: flex; gap: 14px; align-items: flex-end; }
.mini > div { flex: 1; min-width: 0; }
.mini .kpi-big { font-size: 22px; }
.cal { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.cal i {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 800;
  color: var(--muted); box-shadow: var(--inset-sm);
}
.cal i.full { background: linear-gradient(135deg, #1fd3a2, #39a7ff); color: #fff; box-shadow: var(--raised-xs); }
.cal i.part { background: linear-gradient(135deg, #ffd04d, #ffa23a); color: #5c3a00; box-shadow: var(--raised-xs); }
.cal i.miss { background: linear-gradient(135deg, #ff8fae, #ff6f9f); color: #fff; box-shadow: var(--raised-xs); }
.cal i.off { opacity: .45; }
.cal i.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.legend-dots { display: flex; gap: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.legend-dots span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; background: var(--c); }
.cbars { display: grid; gap: 5px; margin-top: 2px; }
.cbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; font-size: 12px; }
.cbar .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.cbar .vl { font-weight: 800; font-variant-numeric: tabular-nums; }
.cbar .meter { grid-column: 1 / -1; height: 7px; margin: 0; }
.cbar .meter > i { background: var(--c); }

/* ---------------- 工数入力: 入力と履歴(1画面に収める) ---------------- */
.page.fit { height: calc(100vh - var(--topbar)); min-height: 600px; grid-template-rows: auto minmax(0, 1fr); padding-bottom: 22px; }
.main-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; min-height: 0; }
.main-row > .card, .leftcol > .card { display: flex; flex-direction: column; min-height: 0; }
.leftcol { display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.leftcol .entry-card { flex: none; }
.cat-card { flex: 1; overflow: auto; }
.cbars.cols2 { grid-template-columns: 1fr 1fr; gap: 12px 22px; padding: 2px 18px 16px; margin: 0; }
.entry-form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px 12px; padding: 2px 18px 4px; }
.entry-form > .field:nth-child(1) { grid-column: span 5; }
.entry-form > .field:nth-child(2) { grid-column: span 4; }
.entry-form > .field:nth-child(3) { grid-column: span 3; }
.entry-form > .f-note { grid-column: span 6; }
.entry-form > .f-amt { grid-column: span 3; }
.entry-form > .f-dur { grid-column: span 3; }
.entry-foot { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.entry-foot .btns { display: flex; gap: 10px; flex-shrink: 0; }
.entry-foot .info { font-size: 11.5px; color: var(--muted); line-height: 1.35; min-width: 0; flex: 1; }
.dur-preview { font-size: 11.5px; color: var(--muted); height: 15px; margin: 3px 0 0 4px; }
.amt-info { font-size: 11.5px; color: var(--muted); margin: 3px 0 0 4px; line-height: 1.4; }
.entry-card .chips { margin-top: auto; padding-top: 6px; padding-bottom: 14px; flex-wrap: nowrap; overflow: hidden; }
.entry-card .chip { max-width: 190px; flex: 0 1 auto; }
.entry-card .chips > .small { white-space: nowrap; flex: none; }
.timerbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0 18px 12px; border-radius: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .16), rgba(255, 126, 179, .16)); box-shadow: var(--inset-sm);
}
.rec { width: 11px; height: 11px; border-radius: 50%; background: var(--c-pink); box-shadow: 0 0 0 4px rgba(255, 111, 159, .25); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.clock { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.timerbar .what { flex: 1; min-width: 160px; }
.hist .weekstrip { padding: 0 18px; }
.weekstrip { display: grid; grid-template-columns: auto repeat(7, minmax(0, 1fr)) auto; gap: 7px; align-items: stretch; }
.weekstrip .btn.icon { width: 30px; height: 100%; min-height: 30px; font-size: 16px; box-shadow: var(--raised-xs); }
.day {
  border: 0; background: var(--surface); box-shadow: var(--raised-xs); border-radius: 14px; padding: 5px 2px; text-align: center; cursor: pointer; min-width: 0; line-height: 1.25;
  transition: transform .12s;
}
.day:hover { transform: translateY(-1px); }
.day .dn { font-size: 11px; color: var(--muted); font-weight: 700; }
.day .dd { font-weight: 800; font-size: 12.5px; white-space: nowrap; }
.day .dh { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.day.sel { background: var(--grad); box-shadow: 0 6px 12px rgba(var(--accent-rgb), .33); }
.day.sel .dn, .day.sel .dd, .day.sel .dh { color: #fff; }
.day.today .dd::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: 3px; vertical-align: 2px; }
.day.sel.today .dd::after { background: #fff; }
.day.off .dn { color: var(--danger); }
.day.full .dh { color: var(--ok); }
.day.sel.full .dh { color: #fff; }
.daysum { display: flex; align-items: center; gap: 10px; padding: 12px 18px 8px; flex-wrap: wrap; }
.daysum .meter { width: 110px; margin: 0; }
.hist-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 16px; display: grid; gap: 9px; align-content: start; }
.hitem {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 12px 9px 14px; border-radius: 16px;
  box-shadow: var(--raised-xs); background: var(--surface);
}
.hitem .hmain { min-width: 0; }
.hitem .hname { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hitem .hname span { font-weight: 600; color: var(--muted); }
.hitem .hsub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hitem .htime { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.hist-list::-webkit-scrollbar { width: 8px; }
.hist-list::-webkit-scrollbar-thumb { background: var(--sh-lo); border-radius: 8px; }
.progress { height: 8px; border-radius: 999px; box-shadow: var(--inset-sm); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.progress.over > i { background: var(--grad-ok); }

/* ---------------- テーブル ---------------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 800; background: var(--surface); position: sticky; top: 0; white-space: nowrap; box-shadow: 0 2px 0 var(--border); }
td.num, th.num { text-align: right; }
tbody tr:hover { background: rgba(var(--accent-rgb), .06); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 800; background: rgba(var(--accent-rgb), .07); border-bottom: 0; }
.bar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.bar > span { flex: 1; height: 9px; border-radius: 999px; box-shadow: var(--inset-sm); overflow: hidden; }
.bar > span > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.bar b { font-weight: 700; font-size: 12px; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.drill { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left; font-weight: 800; }
.drill:hover { text-decoration: underline; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; padding: 18px; align-items: end; }
.stats { display: flex; gap: 14px 30px; padding: 16px 18px; flex-wrap: wrap; align-items: center; }
.stat .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat small { font-size: 12px; font-weight: 700; color: var(--muted); }

/* 入力状況 */
.grid-status th, .grid-status td { padding: 6px 4px; text-align: center; font-size: 12px; min-width: 30px; font-variant-numeric: tabular-nums; }
.grid-status th:first-child, .grid-status td:first-child { text-align: left; padding-left: 14px; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 130px; }
.grid-status thead th:first-child { z-index: 2; }
.grid-status td.off { background: var(--off-bg); color: var(--muted); }
.grid-status td.miss { background: var(--miss-bg); color: var(--danger); font-weight: 800; }
.grid-status th.today { color: var(--accent); }
.grid-status th.off { color: var(--danger); }
.grid-status td.sum { font-weight: 800; padding: 6px 10px; }

/* ---------------- コンボボックス ---------------- */
.combo { position: relative; }
.combo input { padding-right: 32px; }
.combo-clear { position: absolute; right: 6px; top: 7px; width: 24px; height: 24px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 50%; }
.combo-clear:hover { box-shadow: var(--raised-xs); }
.combo-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: 44px; max-height: 280px; overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border-radius: 16px; box-shadow: var(--raised), 0 0 0 1px var(--border); min-width: 240px;
}
.combo-list li { padding: 8px 12px; border-radius: 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.combo-list li small { color: var(--muted); white-space: nowrap; font-weight: 600; }
.combo-list li.act { box-shadow: var(--inset-sm); }
.combo-list li.create { color: var(--accent); font-weight: 800; }
.combo-list li.none { color: var(--muted); cursor: default; }

/* ---------------- タブ / ダイアログ / トースト ---------------- */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; }
.subtabs a { padding: 8px 18px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 800; box-shadow: var(--raised-xs); }
.subtabs a:hover { color: var(--text); }
.subtabs a.on { color: var(--accent); box-shadow: var(--inset-sm); }
dialog { border: 0; border-radius: 26px; padding: 0; background: var(--surface); color: var(--text); width: min(580px, calc(100vw - 24px)); box-shadow: 14px 14px 34px rgba(20, 26, 60, .35), -8px -8px 24px var(--sh-hi); }
dialog.wide { width: min(800px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(60, 66, 110, .45); backdrop-filter: blur(3px); }
.dlg-head { padding: 20px 24px 0; }
.dlg-body { padding: 16px 24px; display: grid; gap: 14px; max-height: 70vh; overflow: auto; }
.dlg-foot { padding: 12px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.dlg-foot .left { margin-right: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 10px; pointer-events: none; }
.toast { background: linear-gradient(135deg, #3a3f66, #2a2e4d); color: #fff; padding: 11px 20px; border-radius: 999px; box-shadow: 0 10px 26px rgba(20, 24, 60, .4); font-weight: 700; animation: pop .22s; max-width: min(540px, 92vw); }
.toast.error { background: linear-gradient(135deg, #e0393e, #b92b5a); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.secret { border-radius: var(--radius-sm); box-shadow: var(--inset); padding: 12px 14px; word-break: break-all; user-select: all; }
pre.secret { margin: 0; white-space: pre-wrap; font-size: 12px; }

/* ---------------- ログイン ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(circle at 15% 20%, rgba(255, 126, 179, .22), transparent 40%), radial-gradient(circle at 85% 80%, rgba(122, 107, 255, .22), transparent 42%), var(--bg); }
.login-card { width: min(420px, 100%); padding: 34px 32px; display: grid; gap: 18px; border-radius: 30px; }
.login-card .brand { font-size: 20px; justify-content: center; }
.login-card .brand-mark { width: 42px; height: 42px; border-radius: 15px; }

/* ---------------- 月次ビュー ---------------- */
.legend { display: flex; gap: 16px; padding: 4px 18px 0; font-size: 12px; color: var(--muted); font-weight: 700; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 5px; }
.legend i.a, .mbars i.a { background: var(--grad); }
.legend i.h, .mbars i.h { background: var(--series2); }
.mchart { display: flex; gap: 12px; padding: 10px 18px 16px; overflow-x: auto; }
.mcol { flex: 1 0 54px; max-width: 110px; }
.mbars { height: 110px; display: flex; align-items: flex-end; justify-content: center; gap: 6px; border-radius: 14px; padding: 0 6px; box-shadow: var(--inset-sm); }
.mbars i { display: block; width: 40%; max-width: 26px; border-radius: 8px 8px 0 0; }
.mcol .ml { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 5px; font-weight: 700; }
.mc { display: grid; line-height: 1.3; }
.mc b { font-weight: 800; }
.mc span { font-size: 11.5px; color: var(--muted); }
.mtable td.total { font-weight: 800; background: rgba(var(--accent-rgb), .07); }
.mtable td, .mtable th { min-width: 84px; }
.mtable td:first-child, .mtable th:first-child { min-width: 180px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.mtable tfoot td:first-child { background: var(--surface); }

/* ---------------- レスポンシブ ---------------- */
@media (max-height: 820px) and (min-width: 1181px) { .leftcol > .cat-card { display: none; } }
@media (max-width: 1180px) {
  .dash { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpi.span3, .kpi.span3b, .kpi.span5, .kpi.span4 { grid-column: span 3; }
  .kpi.span2 { grid-column: span 3; }
  .page.fit { height: auto; min-height: 0; grid-template-rows: auto; }
  .main-row { grid-template-columns: 1fr; }
  .hist-list { max-height: 360px; }
}
@media (max-width: 860px) {
  .topbar { gap: 8px; padding: 0 10px; overflow-x: auto; }
  .tabs-nav a { padding: 0 11px; }
  .tabs-nav .lbl { display: none; }
  .page { padding: 12px; }
  .dash { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi.span3, .kpi.span3b, .kpi.span5, .kpi.span4, .kpi.span2 { grid-column: span 2; }
  .entry-form { grid-template-columns: 1fr; }
  .entry-form > .field, .entry-form > .f-note, .entry-form > .f-amt, .entry-form > .f-dur { grid-column: 1 / -1 !important; }
  .grid2 { grid-template-columns: 1fr; }
  .brand .brand-text { display: none; }
  .weekstrip { grid-template-columns: repeat(7, 1fr); }
  .weekstrip .btn.icon { display: none; }
}
