/* 日々と、珈琲 MEMBERS：ドリップタイマーと同じ「マットな黒＋真鍮色」の見た目 */
:root {
  color-scheme: dark;
  --bg: #121315; --bg-glow: rgba(201, 163, 106, 0.10);
  --surface: #1b1c1f; --surface-2: #232428; --surface-3: #2c2d32;
  --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.13);
  --ink: #eee9e1; --muted: #8f8b84; --faint: #5c5a56;
  --brass: #c9a36a; --brass-ink: #1a1510; --danger: #e58a7e; --ok: #93b8a3;
  --s1: #93b8a3; --s2: #e2a575; --s3: #d895a0; --s4: #94acd0;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --font-num: "Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  background: radial-gradient(1200px 600px at 12% -10%, var(--bg-glow), transparent 60%), var(--bg);
  background-attachment: fixed;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: env(safe-area-inset-top, 0px) 24px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brass); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.brand-mark {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-block;
  background: conic-gradient(from -90deg, var(--s1) 0 25%, var(--s2) 0 50%, var(--s3) 0 75%, var(--s4) 0);
  -webkit-mask: radial-gradient(circle, transparent 10px, #000 11px); mask: radial-gradient(circle, transparent 10px, #000 11px);
}
.brand-sub { font-family: var(--font-mincho); font-size: 12px; color: var(--muted); letter-spacing: .14em; }
.brand-main { font-family: var(--font-num); font-size: 16px; letter-spacing: .34em; }

.btn {
  appearance: none; border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 9px 18px; font-weight: 500; cursor: pointer; min-height: 44px; letter-spacing: .06em;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: rgba(255, 255, 255, .28); }
.btn.primary { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); font-weight: 700; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.btn.small { min-height: 36px; padding: 5px 14px; font-size: 13px; }
.btn.block { width: 100%; }

.flash { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; font-size: 14px; border: 1px solid var(--line-2); }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.flash.err { border-color: color-mix(in srgb, var(--danger) 50%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }

/* ---------- 認証まわり ---------- */
.auth { min-height: calc(100dvh - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding-block: 32px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-brand .brand-mark { width: 44px; height: 44px; -webkit-mask: radial-gradient(circle, transparent 15px, #000 16px); mask: radial-gradient(circle, transparent 15px, #000 16px); margin-bottom: 6px; }
.auth-card {
  width: min(420px, 100%); padding: 28px 24px; border-radius: 24px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 40%), var(--surface);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8);
}
.auth-card h1 { margin: 0 0 18px; font-size: 18px; letter-spacing: .08em; text-align: center; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .14em; }
.field input, .field select, .inline-select {
  height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 0 14px; min-width: 0;
}
.field input:focus { border-color: var(--brass); outline: none; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 12px; border: 1px solid var(--line-2);
  cursor: pointer; font-weight: 500;
}
.choice input:checked + span { border-color: var(--brass); color: var(--brass); background: color-mix(in srgb, var(--brass) 8%, transparent); }
.choice input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-top: 4px; }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.code-input { font-family: var(--font-num); font-size: 24px !important; letter-spacing: .4em; text-align: center; }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 16px; width: fit-content; margin: 0 auto; }
.qr img, .qr svg { display: block; width: 180px; height: 180px; }
.help { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.help summary { cursor: pointer; padding: 12px 14px; font-weight: 500; color: var(--brass); }
.help-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; line-height: 1.7; }
.help-body h3 { font-size: 13px; margin: 8px 0 0; }
.help-body p, .help-body ul { margin: 0; }
.help-body ul { padding-left: 1.2em; }
.help-links { display: flex; gap: 8px; flex-wrap: wrap; }
.help-links .btn { flex: 1 1 140px; }
.secret { font-family: var(--font-num); font-size: 13px; letter-spacing: .12em; text-align: center; word-break: break-all; color: var(--muted); }

/* ---------- ログイン後 ---------- */
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 16px; }
.p-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.p-user { display: flex; align-items: center; gap: 12px; }
.p-user form { margin: 0; }
.p-name { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; line-height: 1.2; }
.p-name small { font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.p-main { max-width: 1100px; margin: 0 auto; padding-block: 8px 24px; }
.p-greet { font-family: var(--font-mincho); font-size: 22px; font-weight: 500; letter-spacing: .08em; margin: 18px 0 22px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 22px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); min-height: 170px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 40%), var(--surface);
  transition: border-color .25s, transform .15s;
}
.tile:hover { border-color: color-mix(in srgb, var(--brass) 50%, transparent); }
.tile:active { transform: scale(.99); }
.tile-icon { width: 56px; height: 56px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--surface-3); }
.tile-icon img { width: 100%; height: 100%; display: block; }
.tile-icon svg { width: 26px; height: 26px; color: var(--brass); }
.tile-name { font-family: var(--font-num); font-size: 15px; letter-spacing: .14em; }
.tile-name.jp { font-family: var(--font-body); letter-spacing: .06em; font-weight: 700; }
.tile-desc { font-size: 13px; color: var(--muted); margin-top: auto; }
.tile.soon { opacity: .5; pointer-events: none; border-style: dashed; }

/* ---------- 管理画面 ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 18px; }
.tabs a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); text-decoration: none; font-size: 14px; }
.tabs a.on { color: var(--brass-ink); background: var(--brass); border-color: var(--brass); font-weight: 700; }
.tabs .count { font-family: var(--font-num); margin-left: 6px; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; font-weight: 500; letter-spacing: .12em; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 12px; color: var(--muted); font-family: var(--font-num); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; display: flex; gap: 6px; align-items: center; }
.inline-select { height: 36px; padding: 0 10px; font-size: 13px; border-radius: 10px; }
.note-form { flex-wrap: nowrap; }
.note-input { width: 9em; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.active { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.pill.pending_approval { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 50%, transparent); }
.pill.suspended { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* スマホ・狭い画面：表を 1 人 1 枚のカードにして、承認などのボタンが画面外に隠れないようにする */
@media (max-width: 760px) {
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { padding: 3px 0; border: 0; }
  .table-wrap td .sub { display: inline; margin-left: 8px; }
  .table-wrap td:first-child .sub { display: block; margin-left: 0; }
  .table-wrap td:last-child { padding-top: 10px; }
  .row-actions form { flex-wrap: wrap; }
  .row-actions .btn { min-height: 44px; }
}

/* アカウント・端末 */
.panel.pad { padding: 20px; }
.panel.pad p { margin: 0; }
.p-title { font-family: var(--font-mincho); font-size: 22px; font-weight: 500; letter-spacing: .08em; margin: 18px 0 16px; }
.p-sub { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--muted); margin: 26px 0 10px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--brass); }
.p-user .btn { white-space: nowrap; }
@media (max-width: 520px) { .p-top { flex-wrap: wrap; } .p-user { flex-wrap: wrap; justify-content: flex-end; gap: 8px; } }

/* ---------- 抽出ログ ---------- */
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.p-head .p-title { margin-bottom: 10px; }
.log-lead { margin: 0 0 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seg { display: flex; gap: 6px; }
.seg label { position: relative; flex: 1; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span {
  display: grid; place-items: center; min-height: 44px; border-radius: 12px; border: 1px solid var(--line-2);
  color: var(--muted); font-family: var(--font-num); cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.seg input:checked + span { border-color: var(--brass); color: var(--brass-ink); background: var(--brass); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.seg .none { font-family: var(--font-body); }
.seg input:checked + .none { background: transparent; color: var(--ink); }
.axis { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 8px; }
.axis small { font-size: 11px; color: var(--faint); text-align: center; line-height: 1.2; }
.stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 38px; line-height: 1; color: var(--line-2); cursor: pointer; padding: 2px 4px; transition: color .15s; }
.stars input:checked ~ label { color: var(--brass); }
.stars input:focus-visible + label { outline: 2px solid var(--brass); border-radius: 8px; }
.tagset { display: flex; flex-wrap: wrap; gap: 8px; }
.tagset label { position: relative; }
.tagset input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.tagset span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: 14px; cursor: pointer; }
.tagset input:checked + span { border-color: var(--brass); color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, transparent); }
.tagset input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.log-form { gap: 16px; }
.log-delete { margin-top: 28px; text-align: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.filters .inline-select { min-width: 0; flex: 1 1 140px; height: 40px; }
.sums { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.sumcard { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.sumcard:hover, .sumcard.on { border-color: color-mix(in srgb, var(--brass) 55%, transparent); }
.sum-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sum-name { font-weight: 700; }
.sum-ov { color: var(--brass); font-family: var(--font-num); white-space: nowrap; }
.sum-n { font-size: 12px; color: var(--muted); font-family: var(--font-num); }
.ax-v { font-family: var(--font-num); font-size: 11px; width: 2em; text-align: right; flex: none; }
.logs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.log { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.log-date { font-family: var(--font-num); font-size: 12px; color: var(--muted); }
.log-stars { color: var(--brass); letter-spacing: .1em; }
.log-name { font-weight: 700; }
.log-detail { font-size: 13px; color: var(--muted); }
.log-axes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.ax { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ax-l { width: 3.2em; flex: none; }
.ax-bar { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brass) calc(var(--v) * 20%), var(--line-2) 0); }
.log-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.log-note { margin: 0; font-size: 14px; }
.log-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--faint); margin-top: auto; }
.more { text-align: center; margin-top: 16px; }
