:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Noto Serif", "Liberation Serif", Georgia, serif;
    --font-mono: "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --bg: #f3f3f1;
    --panel: #ffffff;
    --panel-soft: #f7f7f5;
    --panel-muted: #fafaf8;
    --paper: #fffefb;
    --ink: #111111;
    --muted: #5f6368;
    --line: #d9d9d4;
    --line-strong: #c9c9c3;
    --accent: #0057b8;
    --accent-soft: #e7f0ff;
    --danger: #b42318;
    --shadow: rgba(17, 17, 17, 0.08);
    --shadow-soft: rgba(17, 17, 17, 0.04);
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 20px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 28px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(0, 87, 184, 0.08), transparent 22%),
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.9), transparent 18%),
        linear-gradient(180deg, #fcfcfb 0%, var(--bg) 100%);
}
a { color: var(--accent); }
.shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}
.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}
h1, h2, h3 {
    margin: 0;
    font-family: var(--font-sans);
    letter-spacing: -0.03em;
}
h1 {
    font-size: clamp(2.4rem, 5vw, 4.25rem);
    font-weight: 700;
    line-height: 0.95;
}
.brand-link {
    color: inherit;
    text-decoration: none;
}
h2 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.1;
}
h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}
.lede {
    max-width: 640px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: 0 10px 30px var(--shadow-soft);
}
.wide { grid-column: 1 / -1; }
.auth-panel {
    max-width: 420px;
}
label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}
input[type=text], input[type=password], input[type=email], input[type=number], textarea, select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
}
input[type=text], input[type=password], input[type=email], input[type=number], select {
    min-height: 48px;
}
textarea {
    min-height: 320px;
    resize: vertical;
    line-height: 1.55;
}
button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
}
button.secondary { background: #e5e5e1; color: var(--ink); }
button.danger { background: var(--danger); }
.status, .meta, .empty {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.5;
}
.flash {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 0 0 var(--space-4);
    border: 1px solid var(--line);
}
.flash.success { background: #eef6ff; color: #17406f; }
.flash.error { background: #fff0ee; color: #7a271f; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17, 17, 17, 0.34);
    z-index: 1000;
}
.modal-card {
    width: min(100%, 460px);
    padding: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(17, 17, 17, 0.18);
}
.modal-card h3 {
    margin: 0 0 10px;
}
.modal-preview {
    margin: 16px 0 0;
    color: var(--ink);
    font-size: 0.94rem;
    line-height: 1.5;
}
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
.modal-delete-form {
    margin: 0;
}
.inline-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.3;
}
.inline-status.success {
    background: #eef6ff;
    color: #17406f;
    border-color: rgba(0, 87, 184, 0.14);
}
.inline-status.error {
    background: #fff0ee;
    color: #7a271f;
    border-color: rgba(180, 35, 24, 0.16);
}
.list { display: grid; gap: var(--space-3); }
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    background: var(--panel-muted);
}
.top-actions {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    flex-wrap: wrap;
    padding-top: 8px;
    justify-content: flex-end;
}
.top-actions-nav {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
}
.top-actions-tools {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}
.top-actions-tool-form {
    margin: 0;
}
.top-actions-tool-button {
    min-width: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    border: 1px solid rgba(201, 201, 195, 0.72);
}
.top-actions-tool-button:not(:disabled):hover,
.top-actions-tool-button:not(:disabled):focus {
    color: var(--accent);
    border-color: rgba(0, 87, 184, 0.22);
    background: rgba(239, 246, 255, 0.7);
}
.top-actions-tool-button:disabled {
    cursor: default;
    opacity: 0.42;
}
.top-actions a {
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
.top-actions a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.mono {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    word-break: break-all;
}
.preview {
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    max-height: 280px;
    overflow: auto;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.preview-large {
    max-height: none;
    margin-top: 16px;
}
.item-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: 16px;
    margin-bottom: 12px;
}
.manual-relocate-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.manual-relocate-select {
    min-width: 220px;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.88rem;
}
.compact-action {
    padding: 7px 12px;
    font-size: 0.82rem;
}
.relocate-trigger {
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(0, 87, 184, 0.14);
}
.relocate-trigger:hover,
.relocate-trigger:focus {
    background: #dce9ff;
}
.relocation-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-soft);
}
.relocation-reason {
    margin: 0;
    width: 100%;
}
.relocation-form {
    margin: 0;
}
.badge-action {
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}
.secondary-badge {
    background: #1f9d55;
    color: #fff;
}
.secondary-badge:hover,
.secondary-badge:focus {
    background: #18824a;
}
.tab-row,
.collection-picker-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.tab {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    background: #fff;
    font-size: 0.92rem;
}
.collection-tab {
    justify-content: flex-start;
    width: 100%;
    padding-left: calc(14px + (var(--collection-depth, 0) * 18px));
}
.tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.status-chip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}
.publish-panel .status-chip-row {
    justify-content: flex-end;
}
.status-chip-wrap { position: relative; display: inline-flex; align-items: center; }
.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
}
.status-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    display: none;
    width: 280px;
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    box-shadow: 0 12px 28px var(--shadow);
}
.status-chip-wrap:hover .status-popover,
.status-chip-wrap:focus-within .status-popover { display: block; }
.save-button-muted {
    background: #e5e5e1;
    color: var(--muted);
}
.save-button-active {
    background: var(--accent);
    color: #fff;
}
.inline-link {
    font-size: 0.92rem;
    text-decoration: none;
}
.publish-layout {
    grid-template-columns: 1fr;
}
.lens-layout {
    grid-template-columns: 1fr;
}
.publish-panel {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 254, 251, 0.98) 100%);
    box-shadow: 0 24px 60px rgba(17, 17, 17, 0.06);
}
.lens-panel {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 254, 251, 0.98) 100%);
    box-shadow: 0 24px 60px rgba(17, 17, 17, 0.06);
}
.lens-form {
    display: grid;
    gap: var(--space-4);
}
.lens-note {
    margin: 0 0 24px;
    max-width: 760px;
    font-size: 0.92rem;
    line-height: 1.6;
}
.lens-question-input {
    min-height: 92px;
    height: 92px;
    padding: 20px 24px 18px;
    border-radius: 24px;
    border-color: rgba(201, 201, 195, 0.65);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, var(--paper) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 8px 22px rgba(17, 17, 17, 0.03);
    font-size: 1.02rem;
    line-height: 1.7;
}
.composer-field textarea.lens-question-input {
    min-height: 92px;
    height: 92px;
    padding: 20px 24px 18px;
}
.lens-question-input::placeholder {
    color: #8a8a86;
    font-weight: 520;
}
.lens-actions {
    justify-content: flex-end;
    padding-top: 0;
}
.lens-answer {
    margin-top: var(--space-4);
    padding: 8px 0 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
}
.lens-answer p {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 300;
    letter-spacing: -0.01em;
}
.lens-answer p + p {
    margin-top: 18px;
}
.lens-suggestion {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 300;
    letter-spacing: -0.01em;
}
.lens-answer p + .lens-suggestion,
.lens-suggestion + p,
.lens-suggestion + .lens-suggestion {
    margin-top: 18px;
}
.lens-suggestion-text {
    transition: opacity 160ms ease;
}
.lens-suggestion.completed .lens-suggestion-text {
    opacity: 0.58;
    text-decoration: line-through;
}
.lens-complete-form {
    display: inline;
}
.lens-complete-link {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 0.88rem;
    text-decoration: underline;
    cursor: pointer;
}
.lens-completed-label {
    color: var(--muted);
    font-size: 0.88rem;
}
.money-layout {
    grid-template-columns: 1fr;
}
.money-panel,
.money-list-panel {
    display: grid;
    gap: var(--space-5);
}
.money-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}
.money-head h2,
.money-head h3 {
    margin-bottom: 8px;
}
.money-head .meta {
    margin: 0;
}
.money-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid rgba(201, 201, 195, 0.64);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.72);
}
.money-summary-cell {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-left: 1px solid rgba(201, 201, 195, 0.54);
}
.money-summary-cell:first-child {
    border-left: 0;
}
.money-summary-cell span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}
.money-summary-cell strong {
    font-size: 1.08rem;
}
.money-chart {
    display: grid;
    gap: 10px;
}
.money-chart-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 112px;
    align-items: center;
    gap: 14px;
}
.money-chart-label,
.money-chart-net {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.3;
}
.money-chart-net {
    text-align: right;
    font-weight: 700;
}
.money-chart-bars {
    display: grid;
    gap: 4px;
    min-height: 20px;
}
.money-chart-bar {
    display: block;
    min-width: 2px;
    height: 8px;
    border-radius: 999px;
}
.money-chart-bar.incoming {
    background: #2f855a;
}
.money-chart-bar.outgoing {
    background: #b42318;
}
.money-item-list {
    display: grid;
    gap: 0;
}
.money-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 14px 0;
    border-top: 1px solid rgba(201, 201, 195, 0.48);
}
.money-item-row:first-child {
    border-top: 0;
    padding-top: 0;
}
.money-item-editing {
    display: grid;
    align-items: stretch;
}
.money-item-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.money-item-main strong {
    line-height: 1.3;
}
.money-item-main span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}
.money-source-note {
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}
.money-source-note:hover,
.money-source-note:focus {
    text-decoration: underline;
}
.money-item-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.money-edit-form {
    display: grid;
    gap: var(--space-3);
    width: 100%;
}
.money-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
}
.money-edit-grid label,
.money-edit-form label {
    margin-bottom: 0;
}
.money-edit-grid input,
.money-edit-grid select {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.88rem;
}
.money-notes-field {
    min-height: 72px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
}
.money-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.money-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #f6ebe9;
    color: #8a2d21;
}
.money-pill.incoming {
    background: #eef5ea;
    color: #2f6a2b;
}
.money-stale-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #fff6df;
    color: #8a5a00;
    font-size: 0.74rem;
    font-weight: 700;
}
.linked-money-strip {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(201, 201, 195, 0.64);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.78);
}
.linked-money-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}
.linked-money-items {
    display: grid;
    gap: 8px;
}
.linked-money-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--ink);
    font-size: 0.86rem;
    line-height: 1.4;
    text-decoration: none;
}
.linked-money-item strong {
    font-size: 0.9rem;
}
.positive {
    color: #2f6a2b;
}
.negative {
    color: var(--danger);
}
.publish-intro {
    margin: 8px 0 0;
    max-width: 560px;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.5;
}
.composer {
    margin-top: 0;
    display: grid;
    gap: var(--space-4);
}
.composer-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: 6px;
}
.idea-box {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
}
.collection-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
}
.collection-line strong {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(201, 201, 195, 0.72);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.collection-name-trigger {
    display: inline-flex;
    align-items: center;
    color: inherit;
}
.collection-change {
    margin-left: 0;
    color: inherit;
    font-size: 0.98rem;
}
.collection-picker-card {
    position: relative;
}
.collection-picker-card summary {
    list-style: none;
    cursor: pointer;
}
.collection-picker-card summary:hover strong,
.collection-picker-card summary:focus strong {
    border-color: rgba(0, 87, 184, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 6px 18px rgba(0, 87, 184, 0.08);
}
.collection-picker-card summary::-webkit-details-marker {
    display: none;
}
.collection-picker {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 12;
    margin-top: 0;
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-soft);
    min-width: 280px;
    box-shadow: 0 12px 28px var(--shadow);
}
.collection-picker-card:not([open]) .collection-picker { display: none; }
.composer-field {
    display: grid;
    gap: var(--space-2);
}
.field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: 0;
}
.field-head label {
    margin-bottom: 0;
}
.field-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.recorder-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    padding: 4px 6px 4px 4px;
    border-radius: 999px;
    border: 1px solid rgba(0, 87, 184, 0.10);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(17, 17, 17, 0.04);
}
.recorder-chip-live {
    border-color: rgba(180, 35, 24, 0.16);
    background: rgba(255, 245, 244, 0.96);
}
.recorder-chip-pending {
    border-color: rgba(0, 87, 184, 0.14);
    background: rgba(239, 246, 255, 0.96);
}
.recorder-chip-disabled {
    border-color: var(--line);
    color: var(--muted);
}
.recorder-action,
.recorder-text-action,
.recorder-link-action {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
}
.recorder-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: none;
}
.recorder-stop {
    background: rgba(180, 35, 24, 0.10);
    color: var(--danger);
}
.recorder-link-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
}
.recorder-link-action .recorder-copy {
    color: inherit;
}
.recorder-link-action:hover,
.recorder-link-action:focus {
    text-decoration: underline;
}
.recorder-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
}
.recorder-icon svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: currentColor;
}
.recorder-copy,
.recorder-hint,
.recorder-timer,
.recorder-text-action {
    font-size: 0.8rem;
    line-height: 1;
}
.recorder-copy {
    font-weight: 600;
    color: var(--ink);
}
.recorder-hint,
.recorder-timer {
    color: var(--muted);
}
.recorder-text-action {
    padding: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
}
.recorder-discard {
    color: var(--muted);
}
.help-chip {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
}
.help-popover {
    width: 320px;
}
.help-popover .meta {
    margin: 0 0 8px;
}
.help-popover code {
    font-family: var(--font-mono);
    font-size: 0.88rem;
}
.composer-field textarea {
    min-height: 420px;
    padding: 28px 28px 26px;
    border-radius: 24px;
    border-color: rgba(201, 201, 195, 0.65);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, var(--paper) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 8px 22px rgba(17, 17, 17, 0.03);
    font-size: 1.08rem;
    line-height: 1.72;
}
.composer-field textarea::placeholder {
    color: #8a8a86;
    font-weight: 520;
}
.composer details {
    padding-top: 2px;
}
.composer summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 180ms ease;
}
.composer summary:hover,
.composer summary:focus {
    color: var(--accent);
}
.form-grid-inline {
    margin-top: 12px;
}
.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 600;
}
.checkbox-row input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin: 0;
}
.action-compose-toggle {
    margin-bottom: 10px;
}
.done-compose-toggle {
    margin-bottom: 10px;
}
.confidential-compose-toggle {
    margin-bottom: 8px;
}
.confidential-compose-note {
    margin-top: 0;
    margin-bottom: 0;
}
.summary-area {
    min-height: 140px;
}
.composer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-3);
    padding-top: 8px;
}
.composer-save-button.save-button-muted {
    background: transparent;
    color: var(--muted);
    border: 1px solid rgba(201, 201, 195, 0.72);
    box-shadow: none;
}
.settings-grid {
    align-items: start;
}
.collections-layout {
    grid-template-columns: 1fr;
}
.collections-manager-panel {
    overflow: hidden;
}
.collections-workbench-head {
    margin-bottom: var(--space-5);
}
.collections-workbench-head h2 {
    margin-bottom: 10px;
}
.collections-manager-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.2fr);
    gap: var(--space-5);
    align-items: start;
}
.collection-tree-wrap {
    display: grid;
    gap: var(--space-2);
}
.collection-drop-root {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.84rem;
    background: rgba(255, 255, 255, 0.7);
}
.collection-tree,
.collection-tree-children {
    list-style: none;
    margin: 0;
    padding: 0;
}
.collection-drop-slot,
.collection-drop-root {
    display: block;
}
.collection-drop-slot span,
.collection-drop-root span {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: transparent;
    transition: background 160ms ease;
}
.collection-dragging .collection-drop-slot:hover span,
.collection-dragging .collection-drop-root:hover span {
    background: rgba(0, 87, 184, 0.14);
}
.collection-drop-slot.drag-over span,
.collection-drop-root.drag-over span {
    background: rgba(0, 87, 184, 0.26);
    box-shadow: 0 0 0 1px rgba(0, 87, 184, 0.12);
}
.collection-tree-children {
    margin-left: 18px;
    padding-left: 12px;
    border-left: 1px solid rgba(201, 201, 195, 0.55);
}
.collection-tree-node {
    margin: 0;
}
.collection-tree-row {
    margin: 0 0 8px;
}
.collection-tree-row[draggable="true"] {
    cursor: grab;
}
.collection-tree-row[draggable="true"]:active {
    cursor: grabbing;
}
.collection-tree-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(201, 201, 195, 0.58);
}
.collection-tree-node.drag-over > .collection-tree-row .collection-tree-link {
    border-color: rgba(0, 87, 184, 0.24);
    background: rgba(231, 240, 255, 0.92);
    box-shadow: 0 10px 20px rgba(0, 87, 184, 0.08);
}
.collection-tree-link.active {
    color: var(--accent);
    border-color: rgba(0, 87, 184, 0.18);
    background: var(--accent-soft);
}
.collection-tree-name {
    font-weight: 600;
}
.collection-tree-count {
    color: var(--muted);
    font-size: 0.82rem;
}
.collection-drop-root span {
    display: block;
    height: 14px;
    border-radius: 999px;
    border: 0;
    background: transparent;
}
.collection-drop-slot-end span {
    margin-top: 4px;
}
.collections-side-column {
    display: grid;
    gap: var(--space-4);
    align-content: start;
}
.collections-editor-panel {
    display: grid;
    gap: var(--space-3);
    padding-top: 8px;
}
.collections-preview-panel {
    background: var(--panel-soft);
}
.collections-preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}
.collections-preview-head {
    margin-bottom: var(--space-4);
}
.collections-preview-head h3 {
    margin-bottom: 8px;
}
.compact-item-list {
    display: grid;
    gap: 0;
}
.compact-item-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid rgba(201, 201, 195, 0.44);
    align-items: start;
}
.compact-item-row:first-child {
    border-top: 0;
    padding-top: 4px;
}
.compact-item-date {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: nowrap;
}
.compact-item-main {
    display: grid;
    gap: 8px;
}
.compact-item-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.compact-item-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.compact-item-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 999px;
    background: #e5e5e1;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
}
.compact-item-delete {
    color: var(--danger);
}
.compact-item-text {
    font-size: 0.93rem;
    line-height: 1.55;
    color: var(--ink);
    min-width: 0;
}
.compact-item-text strong {
    font-weight: 700;
}
.item-tag-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.item-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #efefec;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
}
.item-tag-chip.primary {
    background: var(--accent-soft);
    color: var(--accent);
}
.needs-action-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-right: 8px;
    border-radius: 999px;
    background: #eef5ea;
    color: #2f6a2b;
    font-size: 0.74rem;
    font-weight: 700;
    vertical-align: middle;
}
.done-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-right: 8px;
    border-radius: 999px;
    background: #edf1f6;
    color: #3d5168;
    font-size: 0.74rem;
    font-weight: 700;
    vertical-align: middle;
}
.item-tag-remove-form {
    margin: 0;
}
.item-tag-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    opacity: 0.78;
    cursor: pointer;
    transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}
.item-tag-remove-button:hover,
.item-tag-remove-button:focus {
    opacity: 1;
    background: rgba(25, 25, 24, 0.08);
}
.item-tag-chip.primary .item-tag-remove-button:hover,
.item-tag-chip.primary .item-tag-remove-button:focus {
    background: rgba(22, 90, 191, 0.12);
}
.confidential-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-right: 8px;
    border-radius: 999px;
    background: #f6ebe9;
    color: #8a2d21;
    font-size: 0.74rem;
    font-weight: 700;
    vertical-align: middle;
}
.compact-confidential-form {
    margin: 0;
}
.compact-confidential-button {
    padding: 5px 10px;
    border-radius: 999px;
    background: #efefec;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.2;
}
.compact-confidential-button.is-confidential {
    background: #f6ebe9;
    color: #8a2d21;
}
.compact-relocate-trigger {
    flex: 0 0 auto;
    padding: 5px 10px;
    font-size: 0.76rem;
    line-height: 1.2;
}
.compact-item-row .relocation-box {
    margin-bottom: 0;
    padding: 10px 12px;
}
.compact-tag-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.compact-tag-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.compact-tag-form-inline {
    max-width: 220px;
}
.compact-tag-select {
    min-height: 34px;
    min-width: 180px;
    padding: 6px 10px;
    font-size: 0.78rem;
}
.compact-tag-select-inline {
    min-width: 150px;
}
.compact-tag-button {
    padding: 5px 10px;
    font-size: 0.76rem;
    line-height: 1.2;
}
.compact-tag-button.secondary {
    background: #efefec;
    color: var(--ink);
}
.compact-tag-button.tertiary {
    background: transparent;
    color: var(--muted);
    border: 1px solid rgba(201, 201, 195, 0.72);
}
.compact-tag-pill {
    border-radius: 999px;
}
.compact-item-row .relocation-reason {
    font-size: 0.84rem;
}
.explore-map-panel {
    display: grid;
    gap: var(--space-5);
}
.explore-map-mode-banner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 87, 184, 0.16);
    background: rgba(231, 240, 255, 0.8);
    color: #17406f;
    font-size: 0.88rem;
}
.explore-map-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 0.82rem;
}
.explore-map-guide span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(201, 201, 195, 0.52);
}
.explore-map-guide strong {
    color: var(--accent);
    font-size: 0.75rem;
}
.explore-map-head h2 {
    margin-bottom: 10px;
}
.explore-map-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: flex-start;
}
.explore-map-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.explore-terrain-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    background: #e5e5e1;
    color: var(--ink);
}
.explore-map-canvas {
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(201, 201, 195, 0.62);
    border-radius: 24px;
    padding: 18px;
    background:
        radial-gradient(circle at top left, rgba(0, 87, 184, 0.04), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 247, 245, 0.98) 100%);
}
.explore-map-svg {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}
.explore-map-group {
    fill: rgba(231, 240, 255, 0.18);
    stroke: rgba(0, 87, 184, 0.14);
    stroke-width: 1.5;
    stroke-dasharray: 6 6;
    filter: drop-shadow(0 8px 16px rgba(0, 87, 184, 0.05));
}
.explore-map-link {
    fill: none;
    stroke: rgba(17, 17, 17, 0.14);
    stroke-width: 2;
    stroke-linecap: round;
    animation: exploreLineDraw 10s linear infinite;
}
.explore-map-link.dimmed {
    opacity: 0.18;
}
.explore-map-cross-link {
    stroke: rgba(0, 87, 184, 0.28);
    stroke-dasharray: 5 5;
}
.explore-map-node {
    fill: rgba(255, 255, 255, 0.94);
    stroke: rgba(201, 201, 195, 0.82);
    stroke-width: 1.5;
    transition: fill 160ms ease, stroke 160ms ease, filter 160ms ease;
}
.explore-map-node.active,
.explore-map-svg a:hover .explore-map-node,
.explore-map-svg a:focus .explore-map-node {
    fill: rgba(231, 240, 255, 0.95);
    stroke: rgba(0, 87, 184, 0.28);
    filter: drop-shadow(0 12px 18px rgba(0, 87, 184, 0.08));
}
.explore-map-node-wrap {
    transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}
.explore-map-node-wrap.dimmed {
    opacity: 0.26;
}
.explore-map-node-wrap.focused .explore-map-node {
    fill: rgba(231, 240, 255, 0.98);
    stroke: rgba(0, 87, 184, 0.42);
    filter: drop-shadow(0 16px 22px rgba(0, 87, 184, 0.1));
}
.explore-map-node-wrap.emphasis-muted {
    opacity: 0.6;
}
.explore-map-node-wrap.emphasis-highlighted .explore-map-node,
.explore-map-node-wrap.emphasis-focus .explore-map-node {
    stroke: rgba(0, 87, 184, 0.34);
    filter: drop-shadow(0 12px 18px rgba(0, 87, 184, 0.1));
}
.explore-map-node-wrap.emphasis-highlighted {
    transform: translateY(-1px);
}
.explore-map-count-dot {
    fill: var(--accent);
}
.explore-map-count-label {
    fill: #fff;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
}
.explore-map-title {
    fill: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 700;
}
.explore-map-meta {
    fill: var(--muted);
    font-family: var(--font-sans);
    font-size: 0.68rem;
}
.explore-map-activity {
    fill: #c0c5cc;
    opacity: 0.9;
}
.explore-map-activity.fresh {
    fill: #22a06b;
    animation: explorePulse 1.9s ease-in-out infinite;
}
.explore-map-activity.warm {
    fill: #f59e0b;
}
.explore-map-controls {
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 160ms ease, transform 160ms ease;
}
.explore-map-node-wrap:hover .explore-map-controls,
.explore-map-node-wrap.focused .explore-map-controls {
    opacity: 0.95;
    transform: translateX(0);
}
.explore-map-control {
    cursor: pointer;
}
.explore-map-control-dot {
    fill: rgba(255, 255, 255, 0.92);
    stroke: rgba(201, 201, 195, 0.9);
    stroke-width: 1;
    filter: drop-shadow(0 4px 8px rgba(17, 17, 17, 0.08));
}
.explore-map-control:hover .explore-map-control-dot,
.explore-map-control:focus .explore-map-control-dot {
    fill: rgba(231, 240, 255, 0.98);
    stroke: rgba(0, 87, 184, 0.28);
}
.explore-map-control-label {
    fill: var(--accent);
    font-family: var(--font-sans);
    font-size: 0.52rem;
    font-weight: 700;
    pointer-events: none;
}
@keyframes explorePulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}
@keyframes exploreLineDraw {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -24; }
}
.settings-grid .panel {
    padding: var(--space-5);
}
.settings-grid .panel h2 {
    margin-bottom: var(--space-3);
}
.settings-tabs-shell {
    display: grid;
    gap: var(--space-4);
}
.settings-tab-row {
    align-items: center;
}
.settings-logout-form {
    margin: 0 0 0 auto;
}
.settings-logout-pill {
    background: #f1f1ed;
    color: var(--muted);
    border: 1px solid var(--line);
}
.settings-logout-pill:hover,
.settings-logout-pill:focus {
    color: var(--ink);
    background: #ebebe7;
}
.settings-panel {
    max-width: 860px;
}
.confidential-settings-block {
    margin-top: 18px;
}
.confidential-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.sync-inline-status {
    margin: 10px 0 18px;
}
.stacked-form {
    display: grid;
    gap: var(--space-3);
}
.compact-form {
    margin-bottom: 18px;
}
.settings-textarea {
    min-height: 120px;
}
.short-textarea {
    min-height: 120px;
}
.section-head {
    margin: 24px 0 12px;
}
.card-link {
    text-decoration: none;
    color: inherit;
}
.item-card {
    cursor: pointer;
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease,
        background 180ms ease;
}
.item-card:hover {
    border-color: rgba(0, 87, 184, 0.18);
    box-shadow: 0 12px 24px rgba(17, 17, 17, 0.05);
}
.item-card.active {
    background: #ffffff;
    border-color: rgba(0, 87, 184, 0.22);
    box-shadow: 0 14px 28px rgba(0, 87, 184, 0.06);
}
.item-card-head {
    margin-bottom: 8px;
}
.item-card-title-button {
    display: flex;
    width: 100%;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: text;
}
.item-card-title-text,
.item-card-title-static {
    display: block;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}
.item-card-title-edit {
    opacity: 0;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    transition: opacity 160ms ease;
}
.item-card:hover .item-card-title-edit,
.item-card-title-button:focus .item-card-title-edit {
    opacity: 1;
}
.item-title-inline-form {
    display: grid;
    gap: 6px;
}
.item-title-inline-input {
    min-height: 42px;
    padding: 10px 12px;
    border-color: rgba(0, 87, 184, 0.28);
    box-shadow: 0 0 0 3px rgba(0, 87, 184, 0.08);
}
.item-title-inline-status {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.3;
}
.collection-editor-list {
    display: grid;
    gap: var(--space-3);
}
.collections-editor-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: var(--space-3);
}
.collections-new-link {
    text-decoration: none;
}
.collection-editor-card {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    overflow: hidden;
}
.collection-editor-card + .collection-editor-card,
.collection-editor-list + .collection-editor-card {
    margin-top: var(--space-3);
}
.collection-editor-toggle {
    display: block;
    cursor: pointer;
    list-style: none;
    padding: 18px 20px;
}
.collection-editor-toggle::-webkit-details-marker {
    display: none;
}
.collection-editor-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
}
.default-collection-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
}
.collection-tree-title {
    padding-left: calc(var(--collection-depth, 0) * 18px);
}
.collection-editor-description {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.5;
}
.collection-editor-description.empty {
    color: var(--soft);
}
.collection-editor-meta {
    display: block;
    margin-top: 10px;
    color: var(--soft);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.collection-editor-card[open] {
    border-color: var(--line-strong);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}
.collection-editor-card[open] .collection-editor-toggle {
    border-bottom: 1px solid var(--line);
}
.collection-editor-form {
    padding: 18px 20px 20px;
}
.collection-editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
}
.default-collection-form {
    margin: 0;
}
.default-collection-note {
    margin: 0;
}
.terrain-page {
    display: grid;
    gap: var(--space-4);
}
.terrain-stage {
    position: relative;
    width: min(1180px, calc(100vw - 32px));
    height: clamp(520px, 72vh, 780px);
    margin-left: 50%;
    overflow: hidden;
    transform: translateX(-50%);
    background:
        linear-gradient(180deg, #aebdad 0%, #9cae9f 56%, #879d8f 100%);
    box-shadow: 0 24px 70px rgba(17, 17, 17, 0.1);
}
.terrain-scene {
    position: absolute;
    inset: 0;
    touch-action: none;
}
.terrain-scene canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}
.terrain-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 600;
}
.terrain-error {
    color: var(--danger);
}
.terrain-toolbar {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 12px;
    border: 1px solid rgba(201, 201, 195, 0.58);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.07);
    backdrop-filter: blur(14px);
}
.terrain-toolbar span {
    font-size: 0.86rem;
    font-weight: 700;
}
.terrain-zoom-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1.05rem;
    line-height: 1;
}
.terrain-minimap {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    width: 168px;
    height: 118px;
    border: 1px solid rgba(17, 17, 17, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 16px 34px rgba(17, 17, 17, 0.12);
}
.terrain-card-dock {
    position: absolute;
    left: 14px;
    right: 206px;
    bottom: 14px;
    z-index: 4;
    display: flex;
    gap: 10px;
    align-items: stretch;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    pointer-events: none;
    scrollbar-width: none;
}
.terrain-card-dock::-webkit-scrollbar {
    display: none;
}
.terrain-card-empty {
    pointer-events: none;
    align-self: flex-end;
    padding: 10px 12px;
    border: 1px solid rgba(201, 201, 195, 0.58);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
    backdrop-filter: blur(14px);
}
.terrain-thought-card {
    flex: 0 0 min(300px, 76vw);
    display: grid;
    gap: 7px;
    min-height: 126px;
    padding: 14px;
    border: 1px solid rgba(201, 201, 195, 0.64);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 18px 38px rgba(17, 17, 17, 0.12);
    pointer-events: auto;
    backdrop-filter: blur(16px);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.terrain-thought-card:hover,
.terrain-thought-card:focus {
    border-color: rgba(0, 87, 184, 0.24);
    background: rgba(255, 255, 255, 0.94);
    transform: translateY(-2px);
}
.terrain-thought-card strong {
    font-size: 0.94rem;
    line-height: 1.26;
}
.terrain-thought-card span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}
.terrain-thought-card .terrain-thought-meta {
    color: #336456;
    font-size: 0.74rem;
    font-weight: 700;
}
.terrain-empty {
    margin: 0;
}
@media (max-width: 720px) {
    .shell { padding: 20px 16px 32px; }
    .hero { flex-direction: column; gap: var(--space-3); }
    .top-actions { width: 100%; }
    .terrain-nav-link { display: none; }
    .publish-panel { padding: var(--space-5); border-radius: 22px; }
    .composer-topline { align-items: flex-start; flex-direction: column; }
    .publish-panel .field-tools { display: inline-flex; width: 100%; justify-content: flex-start; }
    .publish-panel .field-tools .status-chip-wrap { display: none; }
    .publish-panel .field-tools .recorder-chip { order: -1; }
    .composer-field textarea { min-height: 340px; }
    .settings-panel { max-width: none; }
    .collections-manager-grid { grid-template-columns: 1fr; }
    .compact-item-row { grid-template-columns: 1fr; gap: 6px; }
    .compact-item-topline { flex-direction: column; align-items: stretch; }
    .compact-item-tools { align-self: flex-start; flex-wrap: wrap; }
    .compact-relocate-trigger { align-self: flex-start; }
    .money-summary { grid-template-columns: 1fr; }
    .money-summary-cell { border-left: 0; border-top: 1px solid rgba(201, 201, 195, 0.54); }
    .money-summary-cell:first-child { border-top: 0; }
    .money-chart-row { grid-template-columns: 1fr; gap: 6px; }
    .money-chart-net { text-align: left; }
    .money-item-row { flex-direction: column; align-items: stretch; }
    .money-item-meta { justify-content: flex-start; }
    .explore-map-head { flex-direction: column; }
    .explore-map-actions { justify-content: flex-start; }
    .terrain-stage {
        width: 100vw;
        height: 68vh;
        min-height: 520px;
        margin-left: 50%;
    }
    .terrain-toolbar {
        top: 10px;
        left: 10px;
    }
    .terrain-minimap {
        top: 10px;
        right: 10px;
        bottom: auto;
        width: 118px;
        height: 82px;
    }
    .terrain-card-dock {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    .terrain-card-empty {
        max-width: calc(100vw - 20px);
        white-space: normal;
        border-radius: 8px;
    }
    .terrain-thought-card {
        flex-basis: min(292px, 84vw);
        min-height: 118px;
    }
}

/* Shared Markdown input and sanitized rich output. */
.selo-rich-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:10px 0 5px;font-size:12px;line-height:1.3}
.selo-rich-toolbar button{background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:6px;padding:5px 8px;min-width:29px;min-height:31px;font:inherit;cursor:pointer}
.selo-rich-toolbar button:hover,.selo-rich-toolbar button:focus-visible{background:var(--accent-soft);border-color:var(--accent)}
.selo-rich-toolbar [data-rich-command=bold]{font-weight:700}.selo-rich-toolbar [data-rich-command=italic]{font-style:italic}.selo-rich-toolbar [data-rich-command=underline]{text-decoration:underline}
.selo-rich-toolbar .selo-preview-toggle{margin-left:auto;min-width:66px;font-weight:600}
textarea[data-selo-rich][hidden],.selo-rich-preview[hidden]{display:none!important}
.selo-rich-preview{min-height:90px;max-height:65vh;overflow:auto;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius-sm);padding:16px;cursor:text}
.selo-richtext{white-space:normal;overflow-wrap:anywhere;line-height:1.6;font-weight:400;color:var(--ink)}
.selo-richtext>:first-child{margin-top:0}.selo-richtext>:last-child{margin-bottom:0}
.selo-richtext p{margin:0 0 .8em}.selo-richtext h1,.selo-richtext h2,.selo-richtext h3,.selo-richtext h4{line-height:1.25;margin:1em 0 .45em;letter-spacing:-.02em}.selo-richtext h1{font-size:1.8em}.selo-richtext h2{font-size:1.5em}.selo-richtext h3{font-size:1.2em}
.selo-richtext ul,.selo-richtext ol{padding-left:1.7em;margin:.65em 0}.selo-richtext blockquote{border-left:3px solid var(--accent);margin:1em 0;padding:.2em 1em;color:var(--muted)}
.selo-richtext pre{padding:12px;background:var(--panel-soft);border-radius:8px;overflow:auto;white-space:pre-wrap}.selo-richtext code{font-family:var(--font-mono);font-size:.88em;background:var(--panel-soft);padding:.1em .25em}.selo-richtext pre code{padding:0}.selo-richtext img{max-width:100%;height:auto}.selo-richtext table{display:block;max-width:100%;overflow:auto;border-collapse:collapse}.selo-richtext th,.selo-richtext td{padding:7px 10px;border:1px solid var(--line)}
.compact-item-richtext{margin:8px 0;max-height:20rem;overflow:auto}.compact-item-summary{color:var(--muted);margin:8px 0}.lens-answer{white-space:normal}.selo-readonly-entry{margin-top:16px;padding:16px}
@media(max-width:600px){.selo-rich-toolbar{gap:3px}.selo-rich-toolbar button{padding:5px 7px;min-width:28px}.selo-rich-preview{padding:12px}}
