/* IA Helm. Calm, plain, one accent. Three-level menu: left menu, sub-menu column, tabs. */
:root {
  --ground: #F4F5F2; --surface: #FFFFFF; --soft: #FAFBF9; --ink: #1A1F1D; --muted: #5C6663;
  --line: #DDE2DF; --accent: #0E6B60; --accent-soft: #E3F0ED; --accent-dark: #094C44;
  --warn: #B45309; --warn-soft: #FFEDD5; --danger: #B42318; --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.phonetop { display: none; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.nav1 { flex: 0 0 232px; background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.brand.big { font-size: 22px; justify-content: center; padding-bottom: 24px; }
.brand.big .mark { width: 40px; height: 40px; border-radius: 12px; }
.nav1 .nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; min-height: 42px; }
.nav1 .nav.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav1 .nav span:first-of-type { flex: 1; }
.badge { font-size: 12px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.who { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.who b { font-size: 13px; }
.who small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.out { font-size: 12px; color: var(--muted); }

.subnav { flex: 0 0 216px; background: var(--soft); border-right: 1px solid var(--line); padding: 24px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.subtitle { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 12px 12px; }
.subnav a { display: flex; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; min-height: 40px; }
.subnav a span:first-child { flex: 1; }
.subnav a.active { background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.subnav .count { font-size: 12px; color: var(--muted); font-weight: 600; }

.content { flex: 999 1 560px; min-width: 0; padding: 32px 40px 60px; display: flex; flex-direction: column; gap: 20px; max-width: 1100px; }
.head { display: flex; flex-direction: column; gap: 4px; }
.crumb { font-size: 13px; color: var(--muted); font-weight: 500; }

.phonebar { display: none; }

/* home */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 920px; }
.tile { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; min-height: 140px; }
.tile .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.tile .num { font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.tile .sub { font-size: 13px; color: var(--muted); }
.bigbtn { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; background: var(--accent); color: #fff; border-radius: 12px; padding: 16px 26px; font-size: 17px; font-weight: 600; min-height: 56px; }
.bigbtn:hover { color: #fff; background: var(--accent-dark); }
.block { display: flex; flex-direction: column; gap: 10px; max-width: 920px; }

/* cards and forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card.narrow { max-width: 520px; }
.form { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.form label { font-size: 13px; font-weight: 600; color: var(--muted); }
.form label.inline { white-space: nowrap; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=url], .form input[type=date], .form input[type=search], .form select, .form textarea, .search input {
  font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); color: var(--ink); min-height: 44px; width: 100%;
}
.form textarea { resize: vertical; line-height: 1.5; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--accent); outline-offset: 0; background: #fff; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.btn, .primary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.listening { border-color: var(--warn); color: var(--warn); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; padding: 0 22px; }
.primary:hover { background: var(--accent-dark); color: #fff; }
.error { color: var(--danger); background: #FEE4E2; border-radius: 8px; padding: 8px 12px; margin: 0; font-size: 14px; }
.flash { color: var(--accent-dark); background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin: 0; font-size: 14px; }

/* smart checklist */
.checklist { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 4px 0 0; display: flex; flex-direction: column; gap: 14px; background: var(--soft); }
.checklist legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.checklist legend small { font-weight: 400; color: var(--muted); }
.group { display: flex; flex-direction: column; gap: 6px; }
.group.cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.group.cols > div { display: flex; flex-direction: column; gap: 4px; }
.gl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; flex-direction: column; gap: 1px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; min-height: 44px; justify-content: center; font-weight: 500; font-size: 14px; color: var(--ink); }
.chip small { font-size: 11px; color: var(--muted); font-weight: 400; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink); min-height: 32px; }
.check input { width: 18px; height: 18px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.files:empty { display: none; }
.files .f { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
.files .f img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.files .f button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.thumb img { max-width: 220px; max-height: 220px; border-radius: 10px; border: 1px solid var(--line); }
.filecard { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; }

/* lists */
.search { max-width: 900px; }
.search input { flex: 1; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.tab { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; }
.tab span { color: var(--muted); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.tab.active span { color: #fff; opacity: .85; }
.list { display: flex; flex-direction: column; gap: 8px; max-width: 920px; }
.item { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-height: 60px; }
.item:hover { border-color: var(--accent); color: inherit; }
.item .kind { flex: 0 0 auto; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--ground); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.item .kind.k-idea { background: #FFF4D6; color: #7A4B00; }
.item .kind.k-task { background: var(--accent-soft); color: var(--accent); }
.item .kind.k-money { background: #E7ECFF; color: #1F3A9C; }
.item .kind.k-question, .item .kind.k-request { background: #F3E8FF; color: #6B21A8; }
.item .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .main b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .main small { color: var(--muted); }
.item .when { flex: 0 0 auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.soon p { margin: 0 0 8px; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--ground); }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.kv th { width: 120px; }

/* sign in */
body.bare { display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; }
.auth { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.auth .form { gap: 8px; }
.auth h1 { font-size: 20px; }

/* phone */
@media (max-width: 860px) {
  .shell { display: block; padding-bottom: 76px; }
  .nav1 { display: none; }
  .phonetop { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .phonetop .brand { padding: 0; flex: 1; }
  .phonetop .avatar { width: 28px; height: 28px; font-size: 11px; }
  .subnav { position: static; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
  .subnav .subtitle { display: none; }
  .subnav a { white-space: nowrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; min-height: 38px; }
  .subnav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .subnav .count { color: inherit; margin-left: 6px; }
  .content { padding: 20px 16px 40px; gap: 16px; }
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile { flex-direction: row; align-items: center; min-height: 64px; padding: 14px 16px; }
  .tile .num { font-size: 28px; min-width: 56px; }
  .tile .label { flex: 1; }
  .tile .sub { display: none; }
  .bigbtn { align-self: stretch; justify-content: center; }
  .group.cols { grid-template-columns: 1fr 1fr; }
  .item { flex-wrap: wrap; }
  .item .when { width: 100%; }
  .phonebar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); z-index: 5; }
  .phonebar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; font-size: 11px; font-weight: 500; color: var(--muted); position: relative; }
  .phonebar a.active { color: var(--accent); font-weight: 600; }
  .phonebar .dot { position: absolute; top: -4px; right: 12px; font-size: 10px; font-style: normal; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 6px; }
}
