:root {
      --bg: #f4f1ea;
      --ink: #1d1c19;
      --muted: #5e5a53;
      --line: #ddd6c8;
      --card: #fffcf7;
      --green: #1f3d36;
      --green-2: #2f5d50;
      --amber: #8a5a12;
      --blue: #1d4e89;
      --red: #8c2f2f;
      --chip: #efeae0;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--ink);
      font: 17px/1.5 "Segoe UI", system-ui, sans-serif;
      overflow-x: clip;
      overflow-wrap: break-word;
    }
    header, main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
    header { padding: 76px 0 8px; }
    @media (min-width: 861px) {
      body.start-view header { padding: 0; }
      body.start-view main {
        width: min(860px, calc(100% - 48px));
        min-height: 100vh;
        display: flex;
        align-items: center;
      }
      body.start-view main > .card { width: 100%; }
    }
    .brand {
      position: fixed;
      top: 16px;
      left: 16px;
      z-index: 30;
      font-family: Georgia, "Iowan Old Style", serif;
      font-size: 32px;
      letter-spacing: -0.03em;
    }
    .brand .ai { color: var(--green); font-weight: 700; }
    .banner {
      margin: 16px 0;
      padding: 12px 14px;
      background: #f3e6c8;
      border: 1px solid #e2cf9f;
      border-radius: 10px;
    }
    .layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr); gap: 18px; align-items: start; }
    .layout > * { min-width: 0; }
    #app > * { max-width: 100%; }
    @media (max-width: 860px) {
      .layout { grid-template-columns: 1fr; }
      #app > * + * { margin-top: 16px; }
    }
    .card, .panel {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 18px;
    }
    h1, h2, h3 { font-family: Georgia, "Iowan Old Style", serif; font-weight: 500; letter-spacing: -0.02em; }
    h1 { font-size: 30px; margin: 0 0 8px; }
    h2 { font-size: 22px; margin: 0 0 8px; }
    h3 { font-size: 16px; margin: 16px 0 6px; }
    .muted { color: var(--muted); }
    .opening { color: var(--muted); font-size: 15px; }
    input, textarea {
      width: 100%;
      min-height: 0;
      resize: vertical;
      padding: 12px;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: #fff;
      color: inherit;
      font: inherit;
    }
    textarea { min-height: 120px; }
    label { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }
    .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
    button, a.linkish {
      font: inherit;
      border-radius: 999px;
      border: 1px solid var(--green);
      background: var(--green);
      color: #f7f4ee;
      padding: 8px 14px;
      cursor: pointer;
      text-decoration: none;
      display: inline-block;
    }
    button.secondary, button.quiet {
      background: transparent;
      color: var(--green);
    }
    button.quiet { border-color: var(--line); color: var(--muted); }
    button:disabled { opacity: 0.5; cursor: not-allowed; }
    .rec { border-left: 3px solid var(--green-2); padding-left: 12px; margin: 12px 0; }
    .withheld { border-left-color: var(--amber); }
    ul { margin: 6px 0 0; padding-left: 18px; }
    .group { margin-bottom: 14px; }
    .item { padding: 8px 0; border-top: 1px solid var(--line); }
    .item p { margin: 4px 0; }
    .chips { display: flex; gap: 6px; flex-wrap: wrap; }
    .chip { font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; background: var(--chip); border-radius: 999px; padding: 2px 8px; }
    .chip.locked { color: var(--green-2); }
    .chip.proposed, .chip.researching { color: var(--amber); }
    .chip.deferred { color: var(--muted); }
    .chip.open, .chip.unresolved, .chip.reopened { color: var(--blue); }
    .chip.conflicted, .chip.fail { color: var(--red); }
    .check { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
    .mark { width: 18px; flex: none; }
    pre.export {
      white-space: pre-wrap;
      word-break: break-word;
      background: #f7f4ee;
      border-radius: 10px;
      padding: 12px;
      max-height: 320px;
      overflow: auto;
      font-size: 14px;
    }
    details { margin-top: 12px; color: var(--muted); }
    .foot { color: var(--muted); font-size: 14px; margin: 18px 0 32px; }
    .note { font-size: 14px; }
    .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
    .composer-row {
      display: flex;
      align-items: flex-end;
      gap: 10px;
      max-width: 100%;
    }
    .composer-add {
      flex: none;
      width: 44px;
      height: 44px;
      min-width: 44px;
      min-height: 44px;
      padding: 0;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: #fff;
      color: var(--ink);
    }
    .composer-add.tool-btn { color: var(--ink); }
    .composer-box {
      flex: 1;
      min-width: 0;
      border: 1px solid var(--line);
      border-radius: 28px;
      background: #fff;
      padding: 6px 8px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-width: 100%;
    }
    .composer-inner {
      display: flex;
      align-items: flex-end;
      gap: 6px;
      max-width: 100%;
    }
    .composer-box textarea {
      border: 0;
      background: transparent;
      padding: 10px 8px;
      min-height: 24px;
      max-height: 192px;
      height: 24px;
      resize: none;
      overflow-y: hidden;
      display: block;
      flex: 1;
      min-width: 0;
      line-height: 1.5;
      field-sizing: content;
    }
    .attach-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      max-width: 100%;
      padding: 4px 4px 0;
    }
    .attach-row[hidden] { display: none; }
    .thumb { position: relative; width: 56px; height: 56px; flex: none; }
    .thumb img {
      width: 56px;
      height: 56px;
      object-fit: cover;
      border-radius: 10px;
      border: 1px solid var(--line);
      display: block;
    }
    button.attach-x {
      position: absolute;
      top: -4px;
      right: -4px;
      width: 44px;
      height: 44px;
      min-width: 44px;
      min-height: 44px;
      padding: 0;
      border: 0;
      background: transparent;
      color: #fff;
    }
    button.attach-x span {
      width: 22px;
      height: 22px;
      margin-left: auto;
      border-radius: 999px;
      background: var(--green);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      line-height: 1;
    }
    .file-chip {
      position: relative;
      display: flex;
      align-items: center;
      gap: 6px;
      max-width: 100%;
      min-height: 44px;
      padding: 4px 44px 4px 10px;
      border-radius: 10px;
      background: var(--chip);
      border: 1px solid var(--line);
    }
    .file-kind { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); flex: none; }
    .file-name { font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .input-error { color: var(--red); font-size: 14px; margin: 8px 0 0; }
    h1, h2, h3, p, li, .opening, .note, .tag, .brand { overflow-wrap: break-word; }
    button, a.linkish {
      min-height: 44px;
      max-width: 100%;
      white-space: normal;
      line-height: 1.25;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
    .row > button, .row > a.linkish { min-width: 0; flex: 0 1 auto; }
    summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
    .tool-btn { position: relative; gap: 0; }
    .tool-icons { display: none; }
    .tool-icons svg { display: block; width: 22px; height: 22px; }
    .icon-stop { display: none; }
    .tool-btn.is-live .icon-idle { display: none; }
    .tool-btn.is-live .icon-stop { display: block; }
    @media (max-width: 640px) {
      h1 { font-size: 26px; }
      .card, .panel { padding: 16px; }
      .tools { gap: 10px; }
      .tool-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        padding: 0;
      }
      .tool-icons { display: block; }
      .tool-btn .tool-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
      }
    }
    .composer-actions-right {
      display: flex;
      align-items: center;
      gap: 4px;
      flex: none;
      min-width: 0;
    }
    .composer-actions-right .tool-btn {
      width: 44px;
      height: 44px;
      min-width: 44px;
      min-height: 44px;
      padding: 0;
    }
    .composer-actions-right .tool-icons { display: block; }
    .composer-actions-right .icon-go { display: none; }
    .composer-actions-right .tool-label,
    .composer-add .tool-label {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .composer-add .tool-icons { display: block; }
    .composer-add .icon-go,
    .composer-add .icon-stop { display: none; }
    .composer-actions-right .tool-btn.is-mic,
    .composer-actions-right .tool-btn.is-clear {
      background: transparent;
      border-color: transparent;
      color: var(--muted);
    }
    .composer-actions-right .tool-btn.is-speak,
    .composer-actions-right .tool-btn.is-start {
      background: var(--green);
      color: #f7f4ee;
      border-color: var(--green);
    }
    .composer-actions-right .tool-btn.is-speak {
      width: 48px;
      min-width: 48px;
      border-radius: 999px;
    }
    .composer-actions-right .tool-btn.is-start:not(.is-live) .icon-idle { display: none; }
    .composer-actions-right .tool-btn.is-start:not(.is-live) .icon-go { display: block; }
    .composer-actions-right .tool-btn.is-hidden { display: none; }
    .composer-row { --composer-h: 48px; align-items: flex-end; }
    .composer-add {
      width: var(--composer-h);
      height: var(--composer-h);
      min-width: var(--composer-h);
      min-height: var(--composer-h);
    }
    .composer-box {
      min-height: var(--composer-h);
      padding: 3px 8px 3px 12px;
    }
    .composer-box textarea {
      border: 0;
      border-radius: 0;
      padding: 8px 4px;
      margin: 0;
      line-height: 24px;
      height: 40px;
      min-height: 40px;
      max-height: 192px;
      white-space: pre-wrap;
      overflow-x: hidden;
      outline: none;
      outline-width: 0;
      box-shadow: none;
      -webkit-appearance: none;
      appearance: none;
      -webkit-tap-highlight-color: transparent;
    }
    .composer-box textarea:placeholder-shown {
      field-sizing: fixed;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      height: 40px;
      min-height: 40px;
      max-height: 40px;
    }
    .composer-box textarea::placeholder {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .composer-actions-right .tool-btn {
      width: 40px;
      height: 40px;
      min-width: 40px;
      min-height: 40px;
    }
    .composer-actions-right .tool-btn.is-speak {
      width: 46px;
      min-width: 46px;
      height: 40px;
    }
    .composer-box textarea:focus,
    .composer-box textarea:focus-visible,
    .composer-add:focus,
    .composer-add:focus-visible,
    .composer-actions-right .tool-btn:focus,
    .composer-actions-right .tool-btn:focus-visible,
    button.attach-x:focus,
    button.attach-x:focus-visible {
      outline: none;
      outline-width: 0;
      box-shadow: none;
    }
    .composer-add:focus-visible,
    .composer-actions-right .tool-btn:focus-visible,
    button.attach-x:focus-visible {
      outline: 2px solid var(--green);
      outline-offset: 2px;
    }
    .composer-box:focus-within {
      outline: none;
      border-color: var(--green);
    }
