/* MY IMAI リニューアル試作（2026-11-05）。スマホを基本に、PCでは左メニュー＋広い一覧にする */
:root {
  --blue: #3399cc; --blue-d: #1a79b5; --navy: #16405c; --blue-l: #edf9ff;
  --bg: #f4f7fa; --card: #ffffff; --ink: #222; --ink-2: #555; --ink-3: #8a8f96; --line: #e3e7ec;
  /* 進捗は4色だけ。赤は使わない */
  --st-wait: #7b8ea3;   /* 受付 */
  --st-work: #3399cc;   /* 加工中 */
  --st-ready: #1e9e5a;  /* お受け取りできます（一番目立たせる） */
  --st-done: #b9c0c8;   /* お渡し済 */
  --radius: 8px;
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --num: "Albert Sans", var(--font);
  --tabh: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--blue-d); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.ico { width: 24px; height: 24px; fill: currentColor; flex: none; }
.num { font-family: var(--num); font-feature-settings: "tnum"; }

/* ---- ボタン ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-d); }
.btn.ghost { background: var(--blue-l); color: var(--blue-d); }
.btn.line { border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.btn.big { width: 100%; min-height: 54px; font-size: 17px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* ---- ログイン ---- */
#login { min-height: 100%; display: grid; place-items: center; padding: 32px 20px; background: linear-gradient(180deg, var(--blue-l), #fff 60%); }
.login { width: min(380px, 100%); display: grid; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.brand b { font-family: var(--num); font-size: 26px; letter-spacing: .06em; }
.brand.sm b { font-size: 18px; }
.login .brand { justify-content: center; }
.login-lead { text-align: center; margin: -6px 0 8px; color: var(--ink-2); }
.f { display: grid; gap: 6px; font-weight: 500; font-size: 14px; color: var(--ink-2); }
.f input, .f textarea, .f select { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; min-height: 50px; }
.f input:focus, .f textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(51,153,204,.2); }
.pw { position: relative; display: block; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); }
.keep { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 44px; }
.keep input { width: 22px; height: 22px; accent-color: var(--blue); }
.err { color: #c0392b; margin: 0; min-height: 1.5em; font-weight: 500; }
.forgot { font-size: 14px; color: var(--ink-2); }
.forgot summary { cursor: pointer; color: var(--blue-d); min-height: 32px; }
.demo { font-size: 12px; color: var(--ink-3); text-align: center; margin: 0; }

/* ---- 枠 ---- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px 0 16px; padding-top: env(safe-area-inset-top, 0); background: #fff; border-bottom: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px; border-radius: 10px; font-size: 14px; color: var(--ink-2); max-width: 60vw; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-menu { position: absolute; right: 10px; top: 52px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; display: grid; min-width: 220px; }
.who-menu a, .who-menu button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--ink); text-align: left; }
.who-menu a:hover, .who-menu button:hover { background: var(--bg); }
.tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(var(--tabh) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-top: 1px solid var(--line); }
.tabs a { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--ink-3); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--blue-d); }
.tabs a[aria-current="page"] .ico { transform: scale(1.08); }
.dot { position: absolute; top: 10px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: #e67e22; }
main { padding: 16px 16px calc(var(--tabh) + 24px + env(safe-area-inset-bottom, 0px)); max-width: 760px; margin: 0 auto; outline: none; }
h1 { font-size: 22px; margin: 4px 0 14px; color: var(--navy); }
h2 { font-size: 17px; margin: 24px 0 10px; color: var(--navy); display: flex; align-items: baseline; gap: 8px; }
h2 small { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.muted { color: var(--ink-3); font-size: 14px; }

@media (min-width: 900px) {
  #shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: 56px 1fr; min-height: 100%; }
  .top { grid-column: 1 / -1; }
  .tabs { position: sticky; top: 56px; grid-row: 2; height: calc(100vh - 56px); grid-template-columns: none; grid-auto-rows: 52px; align-content: start; gap: 4px; padding: 16px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .tabs a { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: 10px; font-size: 15px; }
  .tabs a[aria-current="page"] { background: var(--blue-l); }
  .dot { top: 50%; left: auto; right: 14px; transform: translateY(-50%); }
  .tabs a .badge { top: 50%; left: auto; right: 12px; transform: translateY(-50%); }
  main { padding: 24px 32px 48px; max-width: 1040px; margin: 0; width: 100%; }
}

/* ---- お知らせの帯 ---- */
.notice { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; background: #fff8e8; border: 1px solid #f3dca6; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; text-align: left; width: 100%; }
.notice .ico { color: #b7791f; width: 22px; height: 22px; margin-top: 1px; }
.notice b { display: block; font-size: 15px; }
.notice p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.notice .chev { color: var(--ink-3); transition: transform .15s; }
.notice[aria-expanded="true"] .chev { transform: rotate(90deg); }
.notice.plain { background: #fff; border-color: var(--line); }
.notice.plain .ico { color: var(--ink-3); }

/* ---- ホームの数字 ---- */
.tiles { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.tile { display: grid; align-content: space-between; gap: 6px; min-height: 104px; padding: 14px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); text-align: left; }
.tile .k { font-size: 13px; font-weight: 700; color: var(--ink-2); line-height: 1.35; }
.tile .v { font-family: var(--num); font-size: 34px; font-weight: 700; line-height: 1; }
.tile .v small { font-family: var(--font); font-size: 14px; font-weight: 500; margin-left: 2px; }
.tile.ready { background: var(--st-ready); border-color: var(--st-ready); color: #fff; }
.tile.ready .k { color: #fff; }
.tile.work .v { color: var(--st-work); }
.tile.wait .v { color: var(--st-wait); }
.tile.zero { opacity: .55; }

/* ---- 注文カード ---- */
.list { display: grid; gap: 10px; }
.card { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; width: 100%; padding: 14px 14px 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; }
.card:hover { border-color: #b7c3cf; background: #fbfcfd; }
.card .name { font-size: 17px; font-weight: 700; line-height: 1.35; }
.card .sub { grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-2); }
.card .sub b { color: var(--ink); font-weight: 700; }
.card > * { grid-column: 1; }
.card .top-row { display: flex; margin-bottom: 2px; }
.card .side { grid-row: 1 / -1; grid-column: 2; display: grid; align-content: center; }
.card .chev { color: var(--ink-3); }
.card .proc { grid-column: 1; font-size: 13px; color: var(--ink-3); }
.st { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--c) 75%, #000); background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); white-space: nowrap; }
.st.done { color: #5d6670; background: #f1f3f5; border-color: #dde1e6; }
.card .new { margin-left: 8px; align-self: center; font-size: 12px; font-weight: 700; color: #c0561b; }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e05a1f; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-family: var(--num); }
.boxbar { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.boxbar .segs { display: flex; gap: 3px; flex: 1; max-width: 220px; }
.boxbar .segs i { flex: 1; height: 8px; border-radius: 4px; background: var(--c); }
.due-today { color: #b7591f; font-weight: 700; }
.group-h { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 18px 0 8px; }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.more-link { display: flex; justify-content: center; margin-top: 14px; }

/* ---- 注文一覧の絞り込み ---- */
.searchbar { position: sticky; top: 56px; z-index: 5; background: var(--bg); padding: 6px 0 10px; margin: -6px 0 4px; }
.sbox { position: relative; }
.sbox .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.sbox input { width: 100%; font: inherit; font-size: 16px; min-height: 50px; padding: 0 44px 0 46px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; }
.sbox input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51,153,204,.2); }
.sbox .clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip .n { font-family: var(--num); color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-pressed="true"] .n { color: #cfe3f0; }
.chip.period { margin-left: auto; color: var(--ink-2); }
.chip.period select { border: 0; background: transparent; font: inherit; color: inherit; padding: 0; appearance: none; -webkit-appearance: none; cursor: pointer; }
.count { font-size: 13px; color: var(--ink-3); margin: 4px 2px 8px; }

/* ---- 詳細（スマホは下から全画面、PCは右から） ---- */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(15,30,45,.4); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-height: 94vh; overflow: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px)); animation: up .2s ease-out; }
@media (min-width: 900px) {
  .sheet-back { justify-content: flex-end; align-items: stretch; }
  .sheet { width: 520px; max-height: none; height: 100%; border-radius: 0; animation: left .2s ease-out; }
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes left { from { transform: translateX(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-back { animation: none; } }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 0 -16px; padding: 10px 8px 10px 16px; background: var(--bg); }
.sheet-head .t { flex: 1; font-size: 14px; color: var(--ink-3); }
.close { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; }
.close:hover { background: #e6ebf0; }
.d-name { font-size: 21px; font-weight: 700; margin: 0 0 4px; line-height: 1.35; }
.d-proc { color: var(--ink-2); margin: 0 0 14px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0 0 16px; padding: 14px 10px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); list-style: none; }
.steps li { position: relative; display: grid; justify-items: center; gap: 6px; font-size: 12px; text-align: center; color: var(--ink-3); }
.steps li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps .c { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 3px solid var(--line); }
.steps .c .ico { width: 16px; height: 16px; }
.steps li.on { color: var(--ink); font-weight: 700; }
.steps li.on::before, .steps li.past::before { background: var(--blue); }
.steps li.past .c { background: var(--blue); border-color: var(--blue); color: #fff; }
.steps li.on .c { border-color: var(--c); background: var(--c); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0 0 16px; padding: 14px 16px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.facts dt { color: var(--ink-3); font-size: 14px; }
.facts dd { margin: 0; font-weight: 500; }
.memo { background: var(--blue-l); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 16px; }
.boxes { display: grid; gap: 8px; margin-bottom: 18px; }
.boxrow { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.boxrow .bn { font-family: var(--num); font-weight: 700; color: var(--ink-2); }
.boxrow .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.boxrow .acts .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.ship { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.photo { grid-column: 1 / -1; }
.photo img { width: 100%; max-width: 260px; border-radius: 10px; display: block; }
.d-actions { display: grid; gap: 10px; }
@media (min-width: 520px) { .d-actions { grid-template-columns: 1fr 1fr; } }

/* ---- お問い合わせ ---- */
.ask-hero { display: grid; gap: 10px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.ask-hero p { margin: 0; color: var(--ink-2); font-size: 14px; }
.ask-row { display: grid; gap: 10px; }
@media (min-width: 520px) { .ask-row { grid-template-columns: 1fr 1fr; } }
.hist { display: grid; gap: 10px; }
.hitem { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.hitem .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ink-3); }
.hitem h3 { font-size: 16px; margin: 6px 0 4px; }
.hitem p { margin: 0; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.hitem .reply { margin-top: 10px; padding: 10px 12px; background: var(--blue-l); border-radius: 10px; }
.hitem .reply b { font-size: 12px; color: var(--blue-d); display: block; }
.tag { padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--ink-2); font-weight: 500; }
.tag.open { background: #fff1e0; color: #b7591f; }
.form { display: grid; gap: 14px; padding-top: 4px; }

/* ---- トースト・アンケート ---- */
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--tabh) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.2); display: flex; gap: 8px; align-items: center; }
.nps { position: fixed; z-index: 40; right: 16px; bottom: calc(var(--tabh) + 16px + env(safe-area-inset-bottom, 0px)); width: min(400px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.16); padding: 16px; }
@media (min-width: 900px) { .nps, .toast { bottom: 24px; } }
.nps p { margin: 0 32px 10px 0; font-size: 15px; font-weight: 500; }
.nps .x { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); }
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.scale button { min-height: 40px; border-radius: 8px; border: 1.5px solid var(--line); font-family: var(--num); font-weight: 700; }
.scale button[aria-checked="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }
.nps form { display: grid; gap: 10px; margin-top: 12px; }
.nps textarea { font: inherit; font-size: 16px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; }

/* ---- 通知のおすすめ ---- */
.notify { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; margin-top: 12px; padding: 14px 16px; background: var(--blue-l); border: 1px solid #cde8f6; border-radius: var(--radius); font-size: 14px; color: var(--ink-2); }
.notify > .ico { color: var(--blue-d); align-self: start; }
.notify b { display: block; color: var(--ink); font-size: 15px; }
.notify > .btn { grid-column: 1 / -1; }
.notify.on { background: #fff; border-color: var(--line); }
.notify.off { background: #fff; border-color: var(--line); }
.notify.off > .ico { color: var(--ink-3); }
.notify-btns { grid-column: 1 / -1; display: flex; gap: 8px; }
.notify-btns .btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
@media (min-width: 640px) {
  .notify { grid-template-columns: auto 1fr auto; }
  .notify > .btn, .notify-btns { grid-column: auto; }
}

/* ---- お客様アカウント（招待・ID とパスワード） ---- */
.acc-h { font-size: 19px; margin: 4px 0 6px; line-height: 1.4; }
.acc-sub { font-size: 15px; margin: 22px 0 8px; color: var(--ink-2); }
.acc-form { display: grid; gap: 14px; margin-top: 14px; }
.acc-form .f small { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.acc-form.row { grid-template-columns: 1fr auto; align-items: end; }
.acc-form.row .btn { min-height: 50px; }
.acc-later { width: 100%; margin-top: 8px; }
.inv-new { display: grid; gap: 8px; margin-top: 14px; padding: 14px; background: #fff; border: 1px solid var(--st-ready); border-radius: var(--radius); }
.inv-new input { width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.mem-list { display: grid; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.mem { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.mem:first-child { border-top: 0; }
.mem > span { flex: 1; display: grid; gap: 2px; }
.mem small { color: var(--ink-3); font-size: 13px; }
.mem .st { margin-left: 6px; font-size: 12px; }
.mem.off b { color: var(--ink-3); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
@media (max-width: 480px) { .acc-form.row { grid-template-columns: 1fr; } }
/* 真ん中に出すお知らせ（パスワードの決め直しなど）。スマホでも PC でも同じ形 */
.sheet-back.modal { align-items: center; justify-content: center; padding: 16px; }
.sheet-back.modal .sheet { width: min(460px, 100%); height: auto; max-height: calc(100vh - 32px); border-radius: 12px; padding-bottom: 20px; animation: pop .18s ease-out; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.sheet-back.modal .sheet-head { border-radius: 12px 12px 0 0; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet-back.modal .sheet { animation: none; } }
/* 配送（IMAI CRAFT で入れた配送会社と送り状番号） */
.ships { display: grid; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.shiprow { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.shiprow:first-child { border-top: 0; }
.shiprow > span { flex: 1; }
.shiprow .ico { color: var(--ink-3); flex: none; }
