:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #24313a; background: #f6f7f8; font-size: 17px; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 1px solid #ccd4d8; background: #fff; color: inherit; border-radius: 9px; padding: .5rem .75rem; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #5bbab8; outline-offset: 2px; }
button.primary { background: #0b8c88; color: #fff; border-color: #0b8c88; font-weight: 650; }
.shell { max-width: 900px; margin: 0 auto; padding: env(safe-area-inset-top) 16px max(32px, env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0 18px; }
.eyebrow { color: #0b6771; font-weight: 750; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
h1 { margin: 2px 0 0; font-size: 2rem; line-height: 1.15; } h2 { margin: 0 0 12px; font-size: 1.25rem; }
.top-actions { display: flex; align-items: center; gap: 8px; } #sync-status { color: #67757c; font-size: .78rem; white-space: nowrap; } #refresh { font-size: 1.35rem; line-height: 1; }
.login, .add-form { background: #fff; border: 1px solid #e1e6e8; border-radius: 14px; padding: 18px; box-shadow: 0 3px 16px #1421290a; }
.login { max-width: 400px; margin: 48px auto; } .login form { display: grid; gap: 10px; }
.remember-option { display: flex; align-items: center; gap: 8px; font-size: .9rem; padding: 6px 0; }
.remember-option input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
.sync-detail { margin: -4px 0 16px; color: #67757c; font-size: .78rem; line-height: 1.5; }
.sync-detail span { display: block; font-size: .72rem; }
label { font-weight: 580; } input[type=password], input[type=text], input[type=date], textarea, select { border: 1px solid #bac5cb; border-radius: 9px; padding: .6rem .7rem; background: #fff; color: inherit; width: 100%; }
.password-field { position: relative; }
.password-field input { min-height: 48px; padding-inline-end: 54px; }
.password-toggle { position: absolute; inset-inline-end: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: #52646c; }
.password-toggle:hover { background: #e8f3f2; }
.password-toggle .eye-slash { display: none; }
.password-toggle[data-visible=true] .eye-slash { display: block; }
textarea { resize: vertical; min-height: 68px; } .add-form { display: grid; gap: 8px; }
.add-controls { display: flex; gap: 8px; justify-content: flex-end; } .add-controls select { max-width: 220px; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 17px 3px; font-size: .87rem; }
.filters label { color: #5a696f; font-weight: 400; }
.category { margin-bottom: 12px; background: #fff; border: 1px solid #e0e5e8; border-radius: 14px; overflow: hidden; }
.category-head { display: flex; gap: 8px; align-items: center; padding: 12px 15px; background: #eef2f3; }
.category-head h2 { margin: 0; font-size: 1.05rem; } .category-head .count { color: #68777d; font-size: .82rem; }
.category-head h2 { min-width: 0; overflow-wrap: anywhere; }
.category-title { font: inherit; font-weight: inherit; padding: 0; border: 0; background: transparent; text-align: start; }
.new-todo-link { border: 0; background: transparent; color: #0b6771; padding: .3rem .4rem; white-space: nowrap; }
.category-tools .new-todo-link { color: #0b6771; }
.inline-composer { margin: 12px; box-shadow: none; }
.inline-composer .add-controls { flex-wrap: wrap; }
.inline-composer .add-controls select { flex: 1 1 120px; }
.category-tools { margin-left: auto; display: flex; gap: 5px; } .category-tools button { border: 0; background: transparent; padding: .3rem .45rem; color: #4d626a; }
.category.empty .empty-text { display: block; padding: 15px; color: #8b989d; } .empty-text { display: none; }
.task { border-top: 1px solid #e7ebed; padding: 13px 14px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 10px; align-items: start; }
.task:first-of-type { border-top: 0; } .task-check { width: 26px; height: 26px; border-radius: 50%; padding: 0; font-size: 1.1rem; }
.task.done .task-check { background: #0b8c88; color: white; border-color: #0b8c88; } .task.done .task-text { text-decoration: line-through; color: #78868b; }
.task.important .task-text { font-weight: 750; color: #184875; } .task-text { white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 2px; }
.task-meta { color: #738187; font-size: .78rem; margin-top: 5px; } .task-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 142px; }
.task-actions button { border: 0; padding: .2rem .3rem; color: #52646c; background: transparent; font-size: .9rem; }
.task-actions button.starred { color: #174d80; font-weight: bold; } .task-actions button:hover, .category-tools button:hover { background: #e8f3f2; }
.subhead { background: #f9fafb; border-top: 1px solid #e7ebed; color: #68777d; padding: 8px 14px; font-size: .8rem; font-weight: 650; }
.footnote { color: #8b989d; font-size: .78rem; text-align: center; margin: 22px 0; } .error { color: #a12525; white-space: pre-wrap; }
dialog { border: 1px solid #ccd5d9; border-radius: 16px; width: min(95vw, 560px); padding: 0; box-shadow: 0 24px 80px #07182055; } dialog::backdrop { background: #07182075; }
dialog form { padding: 20px; display: grid; gap: 10px; } dialog textarea { min-height: 160px; } fieldset { border: 1px solid #dde5e8; border-radius: 9px; } fieldset label { display: block; font-weight: 400; padding: 5px 0; }
.dialog-actions { display: flex; justify-content: space-between; margin-top: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sio-heartbeat { margin: -4px 0 6px; color: #3f5058; font-size: .85rem; font-weight: 600; }
.sio-heartbeat.warning { color: #8a4b00; }
.sio-sources { list-style: none; margin: 0 0 8px; padding: 0; color: #8a4b00; font-size: .82rem; }
.sio-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 6px; }
.sio-filter { display: flex; border: 0; padding: 0; margin: 0; }
.sio-filter label { position: relative; border: 1px solid #ccd4d8; background: #fff; padding: .45rem .9rem; font-weight: 500; cursor: pointer; }
.sio-filter label + label { border-left: 0; }
.sio-filter label:first-of-type { border-radius: 9px 0 0 9px; } .sio-filter label:last-of-type { border-radius: 0 9px 9px 0; }
.sio-filter input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sio-filter label:has(input:checked) { background: #0b6771; border-color: #0b6771; color: #fff; }
.sio-filter label:has(input:focus-visible) { outline: 3px solid #5bbab8; outline-offset: 2px; z-index: 1; }
.sio-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0 0 8px; font-size: .87rem; }
.sio-search { flex: 1 1 220px; min-width: 0; padding: .55rem .75rem; border: 1px solid #ccd4d8; border-radius: 9px; font: inherit; font-size: 1rem; }
.sio-backlog-toggle { display: block; margin: 4px 0 18px; }
.sio-toggles label { display: flex; align-items: center; gap: 7px; padding: 6px 0; font-weight: 500; color: #3f5058; cursor: pointer; }
.sio-toggles input { width: 20px; height: 20px; margin: 0; }
.sio-note { margin: 0 0 8px; color: #3f5058; font-size: .82rem; } .sio-note:empty { display: none; }
.sio-add { margin-bottom: 14px; } .sio-add .add-controls { flex-wrap: wrap; } .sio-add .add-controls select { flex: 1 1 110px; max-width: none; } .sio-add input[type=date] { width: auto; flex: 1 1 140px; }
.sio-notice { margin: 0 0 8px; padding: 8px 12px; border: 1px solid #f0d3a8; border-radius: 10px; background: #fff7ec; color: #5c3400; font-size: .85rem; overflow-wrap: anywhere; }
.sio-notice.error { border-color: #efc4c4; background: #fdf0f0; color: #8c1f1f; }
.sio-section { margin-bottom: 12px; background: #fff; border: 1px solid #e0e5e8; border-radius: 14px; overflow: hidden; }
.calendar-link { display: inline-block; margin-top: 6px; font-size: .85rem; color: #0b6771; text-decoration: underline; text-underline-offset: 3px; }
.calendar-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
.sio-empty { margin: 0; padding: 12px 15px; color: #5f6e74; }
.sio-item { border-top: 1px solid #e7ebed; border-left: 4px solid transparent; padding: 12px 14px 12px 12px; min-width: 0; }
.sio-grid > .sio-item:first-child { border-top: 0; }
/* Wide screens: cards in adaptive columns, like the Mac app. */
@media (min-width: 900px) {
  .sio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 0 12px 12px; }
  .sio-grid > .sio-item, .sio-grid > .sio-item:first-child { border: 1px solid #e0e5e8; border-left-width: 4px; border-radius: 10px; }
  .sio-grid > .sio-item:not(.emphasized):not(.urgent) { border-left-color: #e0e5e8; }
}
.sio-item.emphasized { background: #f2f9f8; border-left-color: #0b8c88; }
.sio-item.urgent { background: #fdf3f3; border-left-color: #a12525; }
.sio-title { font-weight: 650; overflow-wrap: anywhere; padding-top: 2px; } .sio-item.emphasized .sio-title { font-size: 1.05rem; }
.sio-item.done .sio-title { text-decoration: line-through; color: #5f6e74; }
.sio-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #e3eef7; color: #184875; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.sio-badge.urgent { background: #a12525; color: #fff; }
.sio-next { margin-top: 3px; overflow-wrap: anywhere; }
.sio-meta { margin-top: 4px; color: #5f6e74; font-size: .8rem; }
.sio-project { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: #e3eff0; color: #0b5560; font-weight: 700; }
.sio-pending { margin-top: 4px; color: #8a4b00; font-size: .8rem; font-weight: 650; }
.sio-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .sio-actions:empty { display: none; }
.sio-actions button { padding: .35rem .65rem; font-size: .85rem; }
.sio-actions select.sio-move { width: auto; padding: .35rem .5rem; border-color: #ccd4d8; font-size: .85rem; }
.sio-movable { cursor: grab; }
/* Touch drags start with a long press, which must not select text or open the callout. */
@media (pointer: coarse) { .sio-movable { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
body.sio-dragging { -webkit-user-select: none; user-select: none; cursor: grabbing; }
.sio-ghost { position: fixed; left: 0; top: 0; z-index: 10; margin: 0; pointer-events: none; background: #fff; border: 1px solid #ccd5d9; border-radius: 10px; box-shadow: 0 14px 36px #07182040; opacity: .95; }
.sio-placeholder { margin: 6px 10px; border: 2px dashed #0b8c88; border-radius: 10px; background: #f2f9f8; }
@media (min-width: 900px) { .sio-placeholder { margin: 0; } }
.sio-section.drop-target { border-color: #0b8c88; box-shadow: 0 0 0 2px #5bbab8; }
#sio-edit-title { min-height: 0; resize: none; overflow: hidden; }
.sio-details { margin-top: 6px; color: #4d5d63; font-size: .82rem; } .sio-details summary { cursor: pointer; color: #0b6771; padding: 2px 0; }
.sio-more { margin: 4px 10px 10px; padding: 10px 15px; border: 0; background: transparent; color: #0b6771; font-size: 1.15rem; font-weight: 700; }
.dialog-subject { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
@media (max-width: 560px) { :root { font-size: 16px; } .topbar { align-items: flex-start; } #sync-status { max-width: 66px; white-space: normal; line-height: 1.1; } .task { grid-template-columns: 28px minmax(0,1fr); } .task-actions { grid-column: 2; justify-content: flex-start; max-width: none; } }
.sio-done-links { display: flex; gap: 18px; padding: 4px 15px 12px; }
.sio-link { border: 0; background: transparent; padding: 6px 0; color: #0b6771; font: inherit; font-weight: 650; cursor: pointer; }
.sio-images-field { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.sio-images-field[hidden] { display: none; }
.sio-file { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: .4rem .8rem; border: 1px solid #ccd4d8; border-radius: 9px; background: #fff; font-weight: 500; cursor: pointer; }
.sio-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sio-file:has(input:focus-visible) { outline: 3px solid #5bbab8; outline-offset: 2px; }
.sio-images-field .sio-note { margin: 0; }

/* Read-only task popup. Task actions remain separate buttons. */
.task-detail-trigger { display: block; width: 100%; border: 0; border-radius: 4px; padding: 0; background: transparent; color: inherit; text-align: start; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.task-detail-trigger.sio-title { font-weight: 650; }
.task-detail-trigger:hover { background: transparent; color: #087f72; }
.task-detail-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
#task-detail-dialog { width: min(92vw, 900px); max-height: 88dvh; padding: 0; overflow: hidden; }
#task-detail-dialog[open] { display: flex; flex-direction: column; }
.task-detail-header { display: flex; flex: none; align-items: flex-start; gap: 20px; padding: 24px 24px 16px; }
.task-detail-header h2 { margin: 0; flex: 1; min-width: 0; max-height: 25dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-detail-header button { flex: none; position: sticky; top: 0; }
#task-detail-body { overflow: auto; min-height: 0; line-height: 1.6; padding: 0 24px 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
#task-detail-body p { margin: 0 0 18px; }
#task-detail-body p:last-child { margin-bottom: 0; }
.task-detail-text { font-size: 1.1rem; line-height: 1.6; }
@media (max-width: 520px) {
  .task-detail-header { padding: 18px 16px 12px; gap: 12px; }
  #task-detail-body { padding: 0 16px 20px; }
}
