/* 美松 松風 時間の箱
   形（文字・角の丸み・影・骨格）は松風マニュアル styles_v6.css を受け継ぐ（共有脳 デザインの決まり）。
   色は時間の箱専用：帯は深い青緑 #134e4a、アイコンは山吹 #f2b84b（帯の上で浮く色）、ボタンは青緑。暗い画面は作らない（本人 2026-10-22）。 */
:root {
  --font-primary: 'Inter', 'BIZ UDPGothic', sans-serif;
  --font-display: 'Outfit', 'BIZ UDPGothic', sans-serif;
  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 24px; --radius-full: 9999px;
  --t-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --bg: #f1f5f9; --card: #ffffff; --sunk: #edf0f5; --line: #e2e8f0;
  --text: #0f172a; --text-2: #475569; --text-3: #94a3b8;

  --band: #134e4a;                 /* 帯（PCの左・スマホの上下） */
  --band-text-2: rgba(255,255,255,.66);
  --tab-on: #f5c26b;               /* スマホの下のタブで選んでいる所（帯の色を明るくした山吹） */
  --gold: #f3c886;                 /* 「美松 松風」 */
  --accent: #0f766e;               /* 白地の字にも使える濃さ */
  --accent-light: #e3f3f0;
  --accent-gradient: linear-gradient(135deg, #0f766e 0%, #14958a 100%);
  --accent-glow: rgba(20, 149, 138, .28);

  /* 状態の色 */
  --done: #10b981; --done-bg: rgba(16,185,129,.12);
  --cut: #b45309;  --cut-bg: #fef3c7;
  --over: #ef4444; --over-bg: rgba(239,68,68,.08);

  --shadow: 0 12px 30px -10px rgba(15,23,42,.08), 0 4px 12px -5px rgba(15,23,42,.03);
  --shadow-up: 0 -8px 24px -12px rgba(15,23,42,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font-primary); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; word-break: auto-phrase; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: .01em; }
[data-lucide], svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; }

/* ---------- 骨格 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--band); color: #fff; padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 0 4px; }
.brand-icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; border: 1.5px solid rgba(255,255,255,.18); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.brand-ja { font-family: var(--font-display); font-size: 22px; font-weight: 700; display: flex; flex-direction: column; line-height: 1.15; }
.brand-ja small { font-size: 11px; font-weight: 500; color: var(--gold); letter-spacing: .08em; }
.brand-en { font-size: 9px; font-weight: 600; letter-spacing: .16em; color: var(--band-text-2); margin-top: 3px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-md); color: var(--band-text-2); text-decoration: none; font-weight: 500; transition: background var(--t-fast), color var(--t-fast); }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.on { background: var(--tab-on); color: #3b2a10; font-weight: 700; }
.side-date { margin-top: auto; color: var(--band-text-2); font-size: 13px; padding: 0 6px; }
.count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-full); background: rgba(255,255,255,.16); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.count:empty { display: none; }
.side-nav a.on .count { background: rgba(59,42,16,.15); color: #3b2a10; }

.content { flex: 1; min-width: 0; }
.topbar { display: none; }
#app { max-width: 720px; margin: 0 auto; padding: 36px 32px 64px; }
.screen { display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head h1 { font-size: 26px; }
.date { color: var(--text-2); font-size: 14px; }

/* ---------- カード・ボタン ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: var(--radius-md); padding: 10px 18px; min-height: 46px; font-weight: 700; cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent-gradient); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px var(--accent-glow); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); min-height: 40px; padding: 6px 10px; }
.btn.ghost:hover { background: var(--accent-light); }
.btn.big { min-height: 56px; font-size: 17px; flex: 1 1 140px; }
.btn.cut { color: var(--cut); border-color: #f3d9a4; background: var(--cut-bg); }
.btn.danger { color: var(--over); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: var(--sunk); width: 38px; height: 38px; border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.input { font: inherit; color: var(--text); width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm); padding: 11px 14px; min-height: 48px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea.input { min-height: 130px; resize: vertical; line-height: 1.6; }

/* ---------- いまの箱 ---------- */
.now { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.now.running { border-color: rgba(15,118,110,.35); }
.now.over { border-color: var(--over); background: linear-gradient(var(--over-bg), var(--over-bg)), var(--card); }
.now-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--text-3); }
.now-title { font-size: 20px; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.ring { position: relative; width: min(240px, 64vw); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--sunk); }
.ring .bar { stroke: url(#ringGrad); transition: stroke-dashoffset 1s linear; }
.now.over .ring .bar { stroke: var(--over); }
.ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.digits { font-family: var(--font-display); font-size: clamp(44px, 13vw, 58px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.now.over .digits { color: var(--over); }
.ring .until { font-size: 13px; color: var(--text-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.over-msg { color: var(--over); font-weight: 700; margin: 0; }
.actions { display: flex; gap: 12px; width: 100%; flex-wrap: wrap; }
.idle { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.idle img { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); }
.idle p { margin: 0; color: var(--text-2); }

/* ---------- 今日の並び ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.list-head h2 { font-size: 17px; }
.boxes, .inbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.box { display: flex; align-items: stretch; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform var(--t-fast); width: 100%; text-align: left; padding: 0; }
.box:active { transform: scale(.985); }
.box .when { width: 70px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--sunk); font-family: var(--font-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text-2); gap: 2px; }
.box .when small { font-size: 11px; font-weight: 500; color: var(--text-3); }
.box .what { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.box .title { font-weight: 700; overflow-wrap: anywhere; }
.box .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.minbar { height: 6px; border-radius: var(--radius-full); background: var(--accent-light); position: relative; flex: 0 0 auto; }
.minbar i { position: absolute; inset: 0; border-radius: inherit; background: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: var(--radius-full); padding: 1px 9px; }
.chip.done { background: var(--done-bg); color: #047857; }
.chip.cut { background: var(--cut-bg); color: var(--cut); }
.chip.run { background: var(--accent); color: #fff; }
.chip.tag { background: var(--sunk); color: var(--text-2); }
.chip [data-lucide], .chip svg.lucide { width: 13px; height: 13px; }
.box.run { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow); }
.box.run .when { background: var(--accent); color: #fff; }
.box.run .when small { color: rgba(255,255,255,.8); }
.box.done, .box.cut { box-shadow: none; }
.box.done .title { color: var(--text-3); text-decoration: line-through; }
.box.cut .title { color: var(--text-2); }
.empty { text-align: center; color: var(--text-2); background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius-md); padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { margin: 0; }

.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 6px; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 6px; text-align: center; }
.summary b { display: block; font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.summary span { font-size: 12px; color: var(--text-2); }

/* ---------- 置き場 ---------- */
.drop { display: flex; gap: 10px; padding: 14px; }
.drop .btn { flex-shrink: 0; }
.item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 10px 10px 16px; box-shadow: var(--shadow); }
.item .title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; display: flex; flex-direction: column; gap: 2px; }
.item .title .chip { align-self: flex-start; }
.item .btn { flex-shrink: 0; min-height: 40px; padding: 6px 14px; }
.ai-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.ai-card h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ai-card p { margin: 0; font-size: 13px; color: var(--text-2); }

/* ---------- 下から出る窓 ---------- */
.veil { position: fixed; inset: 0; z-index: 40; background: rgba(15,23,42,.38); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade var(--t-normal); }
.sheet { width: min(460px, 100%); max-height: 88vh; overflow: auto; background: var(--card); border-radius: var(--radius-lg); box-shadow: 0 30px 60px -20px rgba(15,23,42,.4); animation: rise var(--t-normal); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.sheet-head h3 { font-size: 18px; overflow-wrap: anywhere; }
.sheet-body { padding: 10px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.sheet-label { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 0; }
.mins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.min { border: 1.5px solid var(--line); background: var(--card); border-radius: var(--radius-md); padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.min i.blk { display: block; width: 26px; border-radius: 5px; background: var(--accent-light); border: 1.5px solid var(--accent); }
.min[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.min[aria-pressed="true"] i.blk { background: var(--accent); }
.ops { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ops .btn.wide { grid-column: 1 / -1; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { border: 1px solid var(--line); background: var(--sunk); border-radius: var(--radius-full); padding: 6px 14px; cursor: pointer; font-size: 14px; }
.pick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.note { font-size: 13px; color: var(--text-2); margin: 0; min-height: 1.3em; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 50; background: #1e293b; color: #fff; border-radius: var(--radius-full); padding: 10px 18px; font-size: 14px; display: flex; gap: 14px; align-items: center; box-shadow: 0 12px 30px -10px rgba(15,23,42,.5); max-width: calc(100% - 32px); }
.toast button { background: none; border: 0; color: var(--tab-on); font-weight: 700; cursor: pointer; padding: 4px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

/* ---------- スマホ（上の帯＋下のタブ） ---------- */
.tabbar { display: none; }
@media (max-width: 899px) {
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; color: #fff;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
    background: linear-gradient(var(--bg), var(--bg)) top / 100% env(safe-area-inset-top, 0px) no-repeat, var(--band); }
  .topbar .brand-icon { width: 34px; height: 34px; border-radius: 10px; }
  .topbar .brand-ja { font-size: 18px; }
  .topbar .brand-ja small { font-size: 10px; }
  .top-screen { margin-left: auto; font-size: 13px; color: var(--band-text-2); }
  #app { padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .head h1 { font-size: 22px; }
  .card { padding: 20px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--band);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--band-text-2); text-decoration: none; font-size: 12px; font-weight: 700; position: relative; }
  .tabbar a [data-lucide], .tabbar a svg.lucide { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--tab-on); }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 8px); margin: 0; background: var(--tab-on); color: #3b2a10; height: 18px; min-width: 18px; font-size: 11px; padding: 0 5px; }
  .veil { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .summary { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .summary b { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
