/* @anchorvane/ui: the look of the shared parts. A site loads it before its own styles.css, which may go over it. */
:root {
  --background: #ffffff;
  --surface: #ffffff;
  --foreground: #171717;
  --muted: #5f6368;
  --border: #d9dbdf;
  --accent: #171717;
  --accent-text: #ffffff;
  --danger: #c5221f;
  --danger-text: #ffffff;
  --danger-soft: rgba(197, 34, 31, 0.1);
  --amber: #b06000;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --success-soft: rgba(30, 142, 62, 0.12);
  --success: #1e8e3e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --surface: #111214;
    --foreground: #ededed;
    --muted: #a1a5ab;
    --border: #2c2e33;
    --accent: #ededed;
    --accent-text: #0a0a0a;
    --danger: #ea4335;
    --danger-text: #ffffff;
    --amber: #fbbc04;
    --success: #5bb974;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { font-size: clamp(1rem, calc(0.40625rem + min(1.3vh, 0.8vw)), 1.5rem); }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: Arial, Helvetica, sans-serif; line-height: 1.45; }
a { color: inherit; text-underline-offset: 4px; }
h1 { font-size: 1.6rem; margin: 0; font-weight: 600; }
h2 { font-size: 1.05rem; margin: 0; font-weight: 600; }
p { margin: 0; }

.muted { color: var(--muted); font-size: 0.9rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.field input, .field select { font: inherit; font-size: 1rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--foreground); width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid var(--foreground); outline-offset: 1px; }
.button { font: inherit; font-size: 0.95rem; padding: 0.6rem 1rem; border-radius: 0.5rem; border: 1px solid var(--border); background: transparent; color: var(--foreground); cursor: pointer; }
.button:disabled { opacity: 0.55; cursor: default; }
.button-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.button-danger { background: var(--danger); color: var(--danger-text); border-color: var(--danger); }
.button-wide { width: 100%; }
.alert { border-radius: 0.5rem; padding: 0.7rem 0.9rem; font-size: 0.92rem; border: 1px solid; }
.alert-error { background: var(--danger-soft); border-color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: var(--success); }
.alert-amber { background: var(--amber-soft); border-color: var(--amber); }
.alert-info { border-color: var(--border); }
.card { border: 1px solid var(--border); border-radius: 0.75rem; background: var(--surface); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.confirm-panel { border: 1px solid var(--danger); border-radius: 0.5rem; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.75rem; }
.language-choice { display: flex; gap: 0.5rem; }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.link-button[aria-current='true'] { font-weight: 700; text-decoration: none; }

@media (pointer: coarse) {
  .button, .field input, .field select { min-height: 2.75rem; }
}
.field-small { width: auto; font-size: 0.85rem; padding: 0.3rem 0.5rem; }
.field-label { font-size: 0.85rem; color: var(--muted); }
.code, textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
.check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; }
.danger-text { color: var(--danger); }
.payload-builder { display: flex; flex-direction: column; gap: 0.5rem; }
.payload-name { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; overflow-wrap: anywhere; }
.payload-add { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.payload-add input.field { flex: 1; min-width: 7rem; width: auto; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 20; }
.modal { position: fixed; z-index: 21; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; }
input.field, select.field, textarea.field { font: inherit; font-size: 0.95rem; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--foreground); width: 100%; }
input.field:focus, select.field:focus, textarea.field:focus { outline: 2px solid var(--foreground); outline-offset: 1px; }
.mapping-line, .payload-line { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 1.6fr) auto; gap: 0.4rem; align-items: center; font-size: 0.85rem; }
.field textarea { font: inherit; font-size: 0.95rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--foreground); width: 100%; }

/* The conversation screen (approved by the PO, 6 November 2026). */
.icon { display: block; flex: none; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 0.5rem; background: transparent; color: var(--foreground); cursor: pointer; }
.icon-button:hover { background: rgba(0, 0, 0, 0.06); }
.conversation { position: relative; gap: 1.1rem; }
.conversation-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.messages { display: flex; flex-direction: column; gap: 1.1rem; }
.message { display: flex; flex-direction: column; gap: 0.35rem; }
.message-meta { display: flex; align-items: baseline; gap: 0.5rem; }
.message-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.new-line { display: flex; align-items: center; gap: 0.75rem; color: var(--danger); font-size: 0.82rem; margin: 0.2rem 0 0.6rem; }
.new-line::before, .new-line::after { content: ''; flex: 1; border-top: 1px solid var(--foreground); }
.attachments { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.attachment { position: relative; display: inline-flex; }
.attachment-thumb img { display: block; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 0.5rem; background: #f1f3f4; }
.attachment-chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.7rem 0.9rem; border-radius: 0.6rem; background: #f1f3f4; text-decoration: none; font-size: 0.85rem; max-width: 16rem; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-remove { position: absolute; top: -0.45rem; right: -0.45rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 0; background: #5f6368; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.attachment-remove .icon { width: 0.8rem; height: 0.8rem; }
.steps-fold { display: inline-flex; align-items: center; gap: 0.3rem; border: 0; background: transparent; padding: 0; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; align-self: flex-start; }
.steps-fold .icon { width: 0.9rem; height: 0.9rem; }
.steps-box { list-style: none; margin: 0.2rem 0 0; padding: 0.5rem 0.9rem; border: 1px solid var(--border); border-radius: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; align-self: flex-start; font-size: 0.92rem; }
.step { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); }
.step-doing { color: var(--foreground); font-weight: 600; }
.step-todo { opacity: 0.8; }
.step-mark { width: 1rem; display: inline-flex; justify-content: center; }
.step-mark .icon { width: 0.9rem; height: 0.9rem; }
.step-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--foreground); }
.step-ring { width: 0.55rem; height: 0.55rem; border-radius: 50%; border: 1px solid var(--muted); }
.message-box { position: relative; display: flex; flex-direction: column; gap: 0.5rem; }
.message-row { display: flex; align-items: center; gap: 0.5rem; }
.message-input { flex: 1; display: flex; align-items: center; gap: 0.4rem; border: 1px solid var(--border); border-radius: 1.6rem; padding: 0.3rem 0.9rem 0.3rem 0.4rem; }
.message-input textarea { flex: 1; border: 0; outline: none; resize: none; font: inherit; background: transparent; color: inherit; padding: 0.45rem 0; max-height: 10rem; }
.send-button { width: 3rem; height: 3rem; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.send-button:disabled { opacity: 0.4; cursor: default; }
.menu-backdrop { position: fixed; inset: 0; z-index: 30; }
.menu { position: absolute; z-index: 31; min-width: 13rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16); padding: 0.4rem; display: flex; flex-direction: column; }
.menu-top-right { top: 0; right: 0; }
.menu-bottom-left { bottom: 3.5rem; left: 0; }
.menu-head { display: flex; justify-content: flex-end; }
.menu-foot { display: flex; justify-content: flex-start; padding-top: 0.2rem; }
.menu-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 0; background: transparent; border-radius: 0.5rem; font: inherit; color: var(--foreground); text-align: left; cursor: pointer; }
.menu-item:hover { background: rgba(0, 0, 0, 0.06); }
.menu-item-danger { color: var(--danger); }

/* Step 3 of plan v2-next: search bar, Ctrl+K, sharing, recycle bin, history, saved lists, the bell, tagging. */
.search-bar, .tag-input, .bell { position: relative; }
.search-input { min-width: 14rem; }
.search-results { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 0.25rem); max-height: 24rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.15rem; padding: 0.4rem; }
.search-item, .palette-item, .bell-item { display: flex; justify-content: space-between; gap: 0.75rem; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-radius: 0.4rem; padding: 0.5rem 0.6rem; color: inherit; cursor: pointer; }
.search-item:hover, .palette-item:hover, .bell-item:hover, .search-item-active, .palette-item-active { background: rgba(0, 0, 0, 0.06); }
.search-app { font-size: 0.85rem; white-space: nowrap; }
.palette { top: 18%; transform: translate(-50%, 0); display: flex; flex-direction: column; gap: 0.6rem; }
.palette-list { display: flex; flex-direction: column; gap: 0.1rem; max-height: 22rem; overflow-y: auto; }
.palette-foot { font-size: 0.8rem; }
.recent-list { display: flex; flex-direction: column; gap: 0.25rem; }
.recent-item { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.4rem 0; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.share-panel, .recycle-bin, .history, .saved-lists { display: flex; flex-direction: column; gap: 0.75rem; }
.share-row { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.share-add { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; align-items: end; }
.bin-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.history-line { border-left: 2px solid var(--border); padding: 0.1rem 0 0.1rem 0.75rem; }
.history-line p { margin: 0.1rem 0; }
.history-old { text-decoration: line-through; color: var(--muted); }
.bell-button { position: relative; }
.bell-count { position: absolute; top: 0.1rem; right: 0.05rem; min-width: 1.1rem; height: 1.1rem; border-radius: 0.6rem; background: var(--danger); color: var(--danger-text); font-size: 0.7rem; display: flex; align-items: center; justify-content: center; padding: 0 0.25rem; }
.bell-list { position: absolute; z-index: 31; right: 0; top: calc(100% + 0.25rem); width: min(24rem, calc(100vw - 2rem)); max-height: 28rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.6rem; }
.bell-item { flex-direction: column; gap: 0.15rem; }
.bell-item-unread .bell-subject { font-weight: 700; }
.tag-chip { display: inline-block; padding: 0 0.4rem; border-radius: 0.8rem; background: rgba(0, 0, 0, 0.07); color: inherit; text-decoration: none; font-size: 0.92em; }
.tag-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.record-card { position: relative; padding: 0.6rem 0.75rem; }
.record-card p { margin: 0.15rem 0 0; font-size: 0.85rem; }
.record-card-name { color: inherit; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .search-item:hover, .palette-item:hover, .bell-item:hover, .search-item-active, .palette-item-active, .tag-chip { background: rgba(255, 255, 255, 0.1); }
}
.app-tools { gap: 0.25rem; align-items: center; }
.record-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.record-panel h3 { margin: 0; }
.record-tabs { gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.message-box { position: relative; }
.message-tags { position: absolute; bottom: 100%; left: 0; right: 0; z-index: 20; }
.notification-settings { display: flex; flex-direction: column; gap: 0.75rem; min-width: min(36rem, 90vw); }
.settings-app h4 { margin: 0 0 0.4rem; }
.settings-kind { padding: 0.35rem 0; border-bottom: 1px solid var(--border); gap: 1rem; }
