/* ============ shared additions ============ */
.view.full { max-width: none; padding: 0; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn[disabled], .icon-btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn.danger:hover { color: var(--error); background: var(--error-soft); }
.btn-ai { background: linear-gradient(135deg, #8b5cf6, #4f46e5); border-color: transparent; color: #fff; }
.btn-ai:hover { background: linear-gradient(135deg, #7c3aed, #4338ca); }
.spark { font-size: 14px; }
.ai-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-row .muted { font-size: 12.5px; }
.icon-btn.active { background: var(--primary-soft); color: var(--primary); }
code { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }

.badge.b-new { background: #f59e0b; color: #fff; }
.badge.b-shop { background: var(--surface-2); color: var(--text); font-weight: 600; max-width: 100%; }
.badge.b-shop .dot { width: 8px; height: 8px; }
.icard.is-new { box-shadow: 0 0 0 2px color-mix(in srgb, #f59e0b 55%, transparent), var(--shadow); }
.icard > .badge.b-shop { align-self: flex-start; }
.icard-foot .who { margin-left: auto; display: inline-flex; }
.icard-foot .avatar { margin-left: 0; }
.col-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 16px 4px; }
.column.st-col-pending { background: color-mix(in srgb, #f59e0b 9%, var(--surface-2)); }
.chev { display: none; margin-left: 4px; transition: transform .2s; }
.card-move-wrap { display: none; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.card-move { width: auto; min-width: 130px; height: 32px; padding: 0 8px; font-size: 13px; }
.roadmap-name .dot { width: 10px; height: 10px; flex: none; }
.dash-grid > *, .dash-col, .dash-col > .card { min-width: 0; }   /* lets grid children shrink instead of stretching the page */
.roadmap-num { white-space: nowrap; }

.ai-card .ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ai-card .ai-head h3 { margin: 0; }
.ai-out { white-space: pre-wrap; line-height: 1.55; word-break: break-word; }
.ai-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ============ settings ============ */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 900px; }
.set-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.set-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.set-head h2 { margin: 0 0 2px; font-size: 17px; letter-spacing: -.01em; }
.set-head p { margin: 0; font-size: 13px; }
.set-sub { margin: 4px 0 -6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.state-pill { flex: none; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; }
.state-pill.on { background: var(--addition-soft); color: var(--addition); }
.state-pill.off { background: var(--surface-2); color: var(--muted); }
.state-pill.unset { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; }
:root[data-theme="dark"] .state-pill.unset { color: #fbbf24; }

label.switch-row { flex-direction: row; align-items: center; gap: 12px; color: var(--text); font-weight: 550; font-size: 14px; cursor: pointer; }
.switch-row small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 99px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--primary-soft); }

.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 18px; }
label.check { color: var(--text); font-weight: 500; font-size: 13.5px; }
.set-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.test-result { display: none; padding: 10px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 550; }
.test-result.ok { display: block; background: var(--addition-soft); color: var(--addition); }
.test-result.bad { display: block; background: var(--error-soft); color: var(--error); }
.input-btn { display: flex; gap: 8px; }
.input-btn .btn { flex: none; }
.chat-picks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chat-picks:empty { display: none; }
.chat-pick { height: auto; padding: 7px 13px; }
.chat-pick small { opacity: .7; margin-left: 4px; }
.preset-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

details.guide { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; background: var(--surface-2); }
details.guide summary { cursor: pointer; font-weight: 650; color: var(--primary); }
details.guide ol { margin: 12px 0 6px; padding-left: 22px; line-height: 1.75; }
details.guide li { margin-bottom: 4px; }
details.guide p { margin: 8px 0 0; font-size: 13px; }

.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-row, .shop-add { display: flex; align-items: center; gap: 10px; }
.shop-row input[type=color], .shop-add input[type=color] { width: 42px; height: 40px; padding: 3px; flex: none; cursor: pointer; }
.shop-row .shop-name { flex: 1; font-weight: 600; }
.shop-add { padding-top: 6px; border-top: 1px dashed var(--border); }
.shop-add input:not([type=color]) { flex: 1; }

/* ============ notes ============ */
.notes-wrap { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: stretch; min-height: calc(100vh - 190px); }
.notes-list { display: flex; flex-direction: column; overflow: hidden; }
.notes-list-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); }
.notes-list-head .search { max-width: none; flex: 1; }
.notes-items { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 260px); }
.note-item { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.note-item:hover { background: var(--surface-2); }
.note-item.active { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.note-item-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item-prev { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.note-item-prev:empty { display: none; }
.note-item-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.note-editor { display: flex; flex-direction: column; min-width: 0; }
.note-empty { margin: auto; text-align: center; padding: 40px 20px; max-width: 380px; }
.note-empty-ic { font-size: 40px; }
.note-empty h3 { margin: 6px 0; font-size: 20px; }
.note-top { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; }
.note-back { display: none; }
.note-editor input.note-title { flex: 1; font-size: 21px; font-weight: 700; letter-spacing: -.01em; border: 0; background: transparent; padding: 6px 4px; box-shadow: none; }
.note-editor input.note-title:focus { box-shadow: none; }
.note-status { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.note-status.ok { color: var(--addition); }
.note-status.busy { color: var(--muted); }
.note-status.bad { color: var(--error); }
.note-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px 12px; border-bottom: 1px solid var(--border); }
.btn-voice { background: var(--surface); }
.btn-voice.on { background: #e5484d; border-color: #e5484d; color: #fff; animation: pulse 1.4s infinite; }
.seg-mini { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 9px; }
.seg-mini button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 650; color: var(--muted); }
.seg-mini button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.menu-wrap { position: relative; }
.menu { position: absolute; left: 0; top: 40px; z-index: 30; min-width: 270px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 11px; border-radius: 8px; cursor: pointer; gap: 1px; }
.menu button:hover { background: var(--surface-2); }
.menu small { color: var(--muted); font-size: 12px; }
label.private-toggle { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
label.private-toggle.disabled { opacity: .55; }
.note-hint, .note-conflict { margin: 10px 16px 0; padding: 10px 13px; border-radius: 10px; font-size: 13.5px; }
.note-hint { background: color-mix(in srgb, #f59e0b 14%, transparent); }
.note-conflict { background: var(--error-soft); }
.conflict-actions { display: flex; gap: 8px; margin-top: 8px; }
.note-editor textarea.note-body { flex: 1; min-height: 320px; resize: none; border: 0; border-radius: 0; background: transparent; padding: 16px 20px; font-size: 16px; line-height: 1.65; font-family: inherit, "Noto Sans Malayalam", "Nirmala UI", "Kartika", "Malayalam MN", sans-serif; box-shadow: none; }
.note-editor textarea.note-body:focus { box-shadow: none; border: 0; }
.voice-live { display: flex; align-items: center; gap: 10px; margin: 0 16px 10px; padding: 9px 13px; border-radius: 10px; background: color-mix(in srgb, #e5484d 11%, transparent); color: var(--text); font-style: italic; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; animation: pulse 1.2s infinite; flex: none; }
.note-foot { padding: 8px 18px 14px; font-size: 12px; }

.ai-result { margin: 0 16px 12px; border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; }
.ai-result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ai-result-text { white-space: pre-wrap; word-break: break-word; line-height: 1.6; max-height: 260px; overflow: auto; background: var(--surface); border-radius: 9px; padding: 10px 12px; }
.ai-result-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.ai-working { padding: 4px 2px; font-weight: 600; }
.ai-working.bad { color: var(--error); }
.task-pick { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: 9px; padding: 6px 10px; }
label.task-row { flex-direction: row; align-items: center; gap: 10px; padding: 6px 0; color: var(--text); font-weight: 500; }
.task-title { flex: 1; min-width: 0; }
label.inline-select { flex-direction: row; align-items: center; gap: 8px; }
label.inline-select select { width: auto; height: 30px; padding: 0 8px; }

/* ============ whiteboard ============ */
.wb-root { display: flex; flex-direction: column; background: var(--bg); min-height: 380px; }
.wb-bar { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wb-bar select { width: auto; min-width: 170px; height: 34px; padding: 0 10px; font-weight: 600; }
.wb-sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-right: 6px; }
.wb-sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--addition); }
.wb-sync.busy i { background: #f59e0b; }
.wb-sync.bad i { background: var(--error); }
.wb-sync.bad { color: var(--error); }
.wb-zoom { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; }
.wb-zoom button { border: 0; background: transparent; height: 30px; min-width: 32px; padding: 0 8px; border-radius: 7px; cursor: pointer; font-weight: 650; color: var(--text); display: inline-grid; place-items: center; }
.wb-zoom button:hover { background: var(--surface); }
.wb-stage { position: relative; flex: 1; min-height: 0; }
.wb-tools { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 3px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); }
.wb-tools button { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.wb-tools button:hover { background: var(--surface-2); color: var(--text); }
.wb-tools button.active { background: var(--primary); color: #fff; }
.wb-viewport {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  background-color: var(--bg);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--muted) 40%, transparent) 1px, transparent 1.3px);
  background-size: 24px 24px;
}
.wb-viewport.wb-tool-sticky, .wb-viewport.wb-tool-text, .wb-viewport.wb-tool-rect,
.wb-viewport.wb-tool-ellipse, .wb-viewport.wb-tool-arrow, .wb-viewport.wb-tool-pen { cursor: crosshair; }
.wb-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.wb-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.wb-help { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 340px; text-align: center; color: var(--muted); font-size: 14px; pointer-events: none; padding: 16px 20px; background: color-mix(in srgb, var(--surface) 80%, transparent); border-radius: 14px; }

.wb-k-yellow { --fill: #ffe27a; --stroke: #d4a900; }
.wb-k-pink { --fill: #ffb3c1; --stroke: #e5484d; }
.wb-k-blue { --fill: #a5d8ff; --stroke: #2f7bf5; }
.wb-k-green { --fill: #b2f2bb; --stroke: #12a26b; }
.wb-k-orange { --fill: #ffd8a8; --stroke: #f07b1a; }
.wb-k-purple { --fill: #d0bfff; --stroke: #7c3aed; }
.wb-k-dark { --fill: var(--surface); --stroke: var(--text); }

.wb-el { position: absolute; box-sizing: border-box; cursor: move; }
.wb-text { width: 100%; white-space: pre-wrap; word-break: break-word; outline: none; line-height: 1.35; cursor: inherit; }
.wb-el.editing { box-shadow: 0 0 0 2px var(--primary) !important; cursor: text; user-select: text; -webkit-user-select: text; }
.wb-el.editing .wb-text { cursor: text; user-select: text; -webkit-user-select: text; }
.wb-sticky { background: var(--fill); padding: 12px 14px; border-radius: 4px; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); color: #1f2330; font-size: 17px; overflow: hidden; }
.wb-sticky.wb-k-dark { color: var(--text); border: 1px solid var(--border); }
.wb-rect, .wb-ellipse { background: color-mix(in srgb, var(--fill) 45%, transparent); border: 2.5px solid var(--stroke); display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-size: 16px; color: var(--text); overflow: hidden; }
.wb-rect { border-radius: 10px; }
.wb-ellipse { border-radius: 50%; }
.wb-ellipse .wb-text, .wb-rect .wb-text { width: auto; max-width: 100%; }
.wb-text-box, .wb-el.wb-text { font-size: 22px; font-weight: 600; color: var(--text); padding: 4px 6px; background: transparent; }
.wb-el.wb-text > .wb-text { width: 100%; }
.wb-vec .vis { fill: none; stroke: var(--stroke); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.wb-vec .hit { fill: none; stroke: transparent; stroke-width: 22; stroke-linecap: round; pointer-events: stroke; cursor: move; }

.wb-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.wb-sel { position: absolute; border: 2px solid var(--primary); border-radius: 6px; pointer-events: none; }
.wb-handle { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #fff; border: 2.5px solid var(--primary); border-radius: 50%; pointer-events: auto; cursor: nwse-resize; touch-action: none; }
.wb-handle.wb-end { cursor: move; }
.wb-ctx { position: absolute; display: flex; align-items: center; gap: 3px; padding: 5px 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); pointer-events: auto; }
.wb-ctx button { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--text); display: grid; place-items: center; }
.wb-ctx button:hover { background: var(--surface-2); }
.wb-ctx button.danger:hover { background: var(--error-soft); color: var(--error); }
.wb-ctx .wb-sw { width: 22px; height: 22px; margin: 0 2px; border-radius: 50%; border: 2px solid var(--stroke); background: var(--fill); padding: 0; }
.wb-ctx .wb-sw:hover { background: var(--fill); transform: scale(1.12); }
.wb-ctx .wb-sw.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.wb-ctx .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ============ phones and small screens ============ */
@media (hover: none), (max-width: 720px) {
  .card-move-wrap { display: flex; }
}
@media (pointer: coarse) {
  .wb-handle { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
}
@media (max-width: 900px) {
  .notes-wrap { grid-template-columns: 1fr; min-height: 0; }
  .notes-wrap .note-editor { display: none; }
  .notes-wrap.show-editor .notes-list { display: none; }
  .notes-wrap.show-editor .note-editor { display: flex; min-height: calc(100vh - 150px); }
  .note-back { display: inline-grid; }
  .notes-items { max-height: none; }
}
@media (max-width: 720px) {
  .tab span { font-size: 13px; }
  input, select, textarea { font-size: 16px; }              /* stops iPhone Safari zooming into fields */
  .roadmap-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .roadmap-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .mini-item { flex-wrap: wrap; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .column { padding: 8px; }
  .col-head { cursor: pointer; padding: 6px 6px; }
  .chev { display: inline-flex; }
  .column.collapsed .chev { transform: rotate(-90deg); }
  .column.collapsed > :not(.col-head) { display: none; }
  .icard { padding: 12px; }
  .settings-grid { gap: 12px; }
  .set-card { padding: 16px; }
  .shop-row, .shop-add { flex-wrap: wrap; }
  .shop-add input:not([type=color]) { flex: 1 1 160px; }
  .input-btn { flex-wrap: wrap; }
  .note-toolbar { gap: 8px; padding: 8px 12px 12px; }
  .note-top { padding: 12px 12px 4px; }
  .wb-bar { padding: 6px 10px; gap: 4px; }
  .wb-bar select { min-width: 120px; max-width: 150px; }
  .wb-sync span { display: none; }
  .wb-tools { left: 50%; top: auto; bottom: 10px; transform: translateX(-50%); flex-direction: row; max-width: calc(100% - 16px); overflow-x: auto; }
  .wb-tools button { width: 42px; height: 42px; flex: none; }
  .wb-help { max-width: 260px; font-size: 13px; }
}
