/* オプチャ運営OS Web版。色と文字は画面案（2026-10-18）と同じ。 */
:root {
  --ground: #EEF2F0; --paper: #FFFFFF; --ink: #172D3C; --muted: #546B74; --line: #D5E0DC;
  --teal: #248174; --teal-ink: #FFFFFF; --teal-soft: #E3F0EC; --amber: #A96E0A; --amber-soft: #FBF0D9;
  --rose: #B4493A; --rose-soft: #F8E5E1;
  --display: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --ground: #0F1A20; --paper: #16252D; --ink: #E4ECEA; --muted: #9AB0B5; --line: #2A3D45; --teal: #4FB3A3; --teal-ink: #08201C;
  --teal-soft: #1C3833; --amber: #E8B04A; --amber-soft: #3A2F18; --rose: #E58A7C; --rose-soft: #3D2420; color-scheme: dark; } }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.7; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.35; text-wrap: balance; }
h1 { font-size: 24px; font-weight: 900; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* shell */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--paper); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { font-family: var(--display); font-weight: 900; font-size: 17px; padding: 0 10px 4px; }
.ws-name { font-size: 12px; color: var(--muted); padding: 0 10px 14px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--ground); }
.nav a.on { background: var(--teal-soft); color: var(--teal); font-weight: 700; }
.nav a:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.who { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 10px 0; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
main.page { padding: 28px max(16px, 3vw) 64px; display: flex; flex-direction: column; gap: 22px; max-width: 1100px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head p { color: var(--muted); font-size: 14px; }

/* parts */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 700; border-radius: 10px; padding: 8px 16px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--teal); }
.btn.main { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
.btn.small { font-size: 12.5px; padding: 4px 10px; border-radius: 8px; }
.btn.danger { color: var(--rose); }
.btn[disabled] { opacity: .55; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grid-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.task { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.task.urgent { border-color: var(--rose); }
.task b { font-size: 15px; }
.task small { color: var(--muted); font-size: 13px; line-height: 1.6; flex: 1; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 99px; white-space: nowrap; width: fit-content; }
.chip.teal { background: var(--teal-soft); color: var(--teal); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.rose { background: var(--rose-soft); color: var(--rose); }
.chip.plain { border: 1px solid var(--line); color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat strong { font-family: var(--display); font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
thead th { font-size: 12px; color: var(--muted); font-weight: 500; background: var(--ground); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.empty { color: var(--muted); text-align: center; padding: 24px; }
.code { font-family: var(--display); font-weight: 900; letter-spacing: .06em; }

/* forms */
form.stack { display: flex; flex-direction: column; gap: 14px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.field small { font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], select, textarea {
  font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.error { color: var(--rose); font-size: 13.5px; }
.secret { background: var(--ground); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; }
.hint { background: var(--teal-soft); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-size: 13.5px; }
.hint.warn { background: var(--amber-soft); }

/* login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.center .card { width: 100%; max-width: 400px; padding: 28px; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--paper); color: var(--ink); width: min(640px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 20, 25, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 14px; max-height: 75vh; overflow-y: auto; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 99px; font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); }
#toast.bad { background: var(--rose); color: #fff; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 100%; }
  .ws-name { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav a { padding: 6px 10px; }
  .who { width: 100%; flex-direction: row; justify-content: space-between; margin-top: 4px; }
  main.page { padding: 20px 16px 48px; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .nav a { transition: background-color .12s, border-color .12s; } }

.linkish { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; font-size: 13px; justify-self: start; text-decoration: underline; cursor: pointer; }
.forgot { display: grid; gap: 4px; margin-top: 4px; }
