/* 受け渡し口 — Linear 風の黒ベース */
:root {
  color-scheme: dark;
  --bg: #0f1011;
  --bg-2: #151619;
  --bg-3: #1c1d22;
  --bg-4: #24252b;
  --line: #34353b;
  --line-2: #45464d;
  --line-3: #585962;
  --fg: #ffffff;
  --fg-2: #e6e7ea;
  --fg-3: #c6c8cd;
  --accent: #5e6ad2;
  --accent-2: #707ae3;
  --accent-ring: rgba(94, 106, 210, .35);
  --red: #e5484d;
  --red-2: #f0787c;
  --green: #4cc38a;
  --radius: 6px;
  --radius-lg: 10px;
}
html { font-size: 14px; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Inter Variable", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Yu Gothic UI", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}
a { color: inherit; }
h1 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 1.25rem; }
h2 { font-size: .86rem; font-weight: 500; color: var(--fg-2); margin: 2rem 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.count { font-size: .78rem; font-weight: 500; color: var(--fg-2); background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 .5rem; line-height: 1.5; }

/* 上の帯 */
.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  height: 48px; padding: 0 1.25rem; padding-top: env(safe-area-inset-top);
  background: rgba(15, 16, 17, .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; letter-spacing: -0.01em; text-decoration: none; color: var(--fg); }
.menu { display: flex; align-items: center; gap: .25rem; }
.menu form { margin: 0; }
.me { color: var(--fg-2); margin-right: .5rem; }
.menu .btn { background: transparent; border-color: transparent; color: var(--fg-2); }
.menu .btn:hover, .menu .btn:focus-visible { background: var(--bg-3); color: var(--fg); border-color: transparent; }

main { max-width: 52rem; margin: 0 auto; padding: .5rem 1.25rem 1rem; }
main.narrow { max-width: 22rem; padding-top: 12vh; }

/* 一覧 */
.list { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-2); overflow: hidden; }
.row { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row:hover { background: rgba(255, 255, 255, .025); }
.row.off { color: var(--fg-3); }
.main { flex: 1; min-width: 0; }
.name { font-weight: 500; overflow-wrap: anywhere; }
.name .sub { font-weight: 400; font-size: .93rem; color: var(--fg-3); margin-left: .5rem; }
.row.off .name { color: var(--fg-3); }
.meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--fg-2); font-size: .93rem; }
.meta .sub { color: var(--fg-3); }
.tag { font-size: .78rem; color: var(--fg-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 .4rem; margin-left: .4rem; vertical-align: 1px; }
.actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; flex-shrink: 0; }
.actions form { margin: 0; display: flex; gap: .5rem; align-items: center; }
.actions form.inline input { width: 12rem; }
.empty { color: var(--fg-3); margin: .25rem 0 0 .25rem; }

/* 押すもの */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 .85rem;
  font: inherit; font-size: .93rem; font-weight: 500; white-space: nowrap;
  color: var(--fg); background: var(--bg-3);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--bg-4); border-color: var(--line-3); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--red-2); }
.btn.danger:hover { background: rgba(229, 72, 77, .12); border-color: rgba(229, 72, 77, .4); }
.btn.big { width: 100%; height: 38px; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: default; }

/* 入力 */
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-2); padding: 1rem 1.25rem 1.25rem; }
.field { margin: .9rem 0; }
.field > label, .field > .label { display: block; font-size: .86rem; color: var(--fg-2); margin-bottom: .35rem; }
input, select {
  font: inherit; font-size: 1rem; height: 36px; padding: 0 .7rem; width: 100%;
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder { color: var(--fg-3); }
input:hover, select:hover { border-color: var(--line-3); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input[type="file"] { padding: .4rem .7rem; height: auto; color: var(--fg-2); }
input[type="file"]::file-selector-button {
  font: inherit; font-size: .93rem; font-weight: 500; color: var(--fg);
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 4px;
  padding: .2rem .7rem; margin-right: .7rem; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: auto; height: auto; accent-color: var(--accent); }
.auth-actions { margin-top: 1.25rem; }

/* 招待リンク */
.invite-link { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .93rem; overflow-wrap: anywhere; padding: .6rem .8rem; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius); margin-bottom: .75rem; user-select: all; }
.invite-form { margin: .75rem 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.invite-form select { width: auto; min-width: 12rem; }
.groups-of { margin-top: .6rem; display: flex; gap: .5rem .75rem; align-items: center; flex-wrap: wrap; }
.groups-of .label { color: var(--fg-2); font-size: .93rem; }
.groups-of form.inline { display: flex; gap: .35rem; align-items: center; margin: 0; }
.groups-of select { width: auto; min-width: 11rem; height: 32px; padding: 0 .5rem; }
.tag.on { margin-left: 0; border-color: var(--accent); background: rgba(94, 106, 210, .18); color: var(--fg); font-size: .93rem; padding: .15rem .55rem; }
.btn.small { height: 28px; padding: 0 .55rem; font-size: .86rem; }

/* このシステムについて */
main.about { max-width: 40rem; padding-top: 2rem; }
.about-list { padding-left: 1.5rem; margin: 0 0 1.5rem; line-height: 1.8; }
.about-list li { margin: .5rem 0; padding-left: .25rem; }
.about-link { margin-top: 1.25rem; text-align: center; }
.about-link a { color: var(--fg-2); }

/* 入口の文言 */
.org { margin: -0.75rem 0 1.25rem; color: var(--fg-2); font-size: .93rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.org .tag { margin: 0; }
.note { margin: 1.5rem 0 0; padding: .1rem 0 .1rem 1rem; border-left: 2px solid var(--line-3); color: var(--fg-2); font-size: .93rem; line-height: 1.8; }

/* 相手（社長は複数） */
.checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.check {
  display: inline-flex; align-items: center; gap: .5rem; height: 32px; padding: 0 .75rem;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); cursor: pointer; color: var(--fg-2);
}
.check:hover { border-color: var(--line-3); color: var(--fg); }
.check:has(input:checked) { border-color: var(--accent); color: var(--fg); background: rgba(94, 106, 210, .12); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }

/* 期限 */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: flex; align-items: center; justify-content: center; height: 28px; padding: 0 1rem; border-radius: 4px; color: var(--fg-2); font-weight: 500; cursor: pointer; }
.seg span:hover { color: var(--fg); }
.seg input:checked + span { background: var(--bg-4); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

/* 知らせ */
.msg { padding: .55rem .85rem; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-2); margin: .75rem 0; }
.msg.ok { color: var(--green); border-color: rgba(76, 195, 138, .35); }
.msg.err { color: var(--red-2); border-color: rgba(229, 72, 77, .4); }

/* 記録 */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; display: table; }
table.list th, table.list td { text-align: left; padding: .55rem .8rem; border-top: 1px solid var(--line); vertical-align: top; }
table.list thead th { font-size: .78rem; font-weight: 500; color: var(--fg-2); border-top: 0; background: var(--bg-3); position: sticky; top: 48px; }
table.list tbody tr:hover td { background: rgba(255, 255, 255, .025); }
td.fname { overflow-wrap: anywhere; }

@media (max-width: 700px) {
  html { font-size: 15px; }
  input, select { font-size: 16px; height: 42px; }
  main { padding: .5rem 1rem 1rem; }
  main.narrow { padding-top: 8vh; }
  .top { height: auto; min-height: 48px; padding: .4rem 1rem; padding-top: calc(.4rem + env(safe-area-inset-top)); flex-wrap: wrap; }
  .brand { font-size: .93rem; }
  .menu .btn { padding: 0 .5rem; }
  .row { flex-direction: column; align-items: stretch; gap: .6rem; padding: .85rem 1rem; }
  .actions { width: 100%; }
  .actions .btn, .actions form { width: 100%; }
  .actions form.inline { flex-wrap: wrap; }
  .actions form.inline input { width: 100%; }
  .btn { height: 42px; }
  .seg { display: flex; }
  .seg label { flex: 1; }
  .seg span { height: 36px; padding: 0; }
  .check { height: 40px; }
  table.list { display: block; border: 0; background: transparent; }
  table.list thead { display: none; }
  table.list tbody { display: block; }
  table.list tr { display: block; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-2); margin: .5rem 0; padding: .4rem .9rem; }
  table.list td { display: flex; gap: .8rem; border: 0; padding: .2rem 0; }
  table.list td::before { content: attr(data-l); min-width: 4.5em; color: var(--fg-3); }
}
