:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    --page: #fff;
    --surface: #fff;
    --column: #f5f5f7;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --border: #d2d2d7;
    --accent: #007aff;
    --accent-hover: #0062cc;
    --teal: #248a3d;
    --danger: #c9342d;
    --warning: #946200;
    --focus: #007aff40;
    color: var(--text);
    background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; }
main { max-width: 1440px; margin: auto; padding: 0 40px 24px; }
button, input, textarea { font: inherit; -webkit-tap-highlight-color: transparent; }
button { appearance: none; min-height: 36px; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color 140ms, box-shadow 140ms; }
button:hover { background: var(--accent-hover); }
button:active { filter: brightness(.96); }
button:disabled { opacity: .45; cursor: default; }
button.secondary, #refresh { background: #e8e8ed; color: var(--text); }
button.secondary:hover, #refresh:hover { background: #dedee5; }
button.quiet { background: transparent; color: var(--muted); }
button.quiet:hover { background: #e8e8ed; color: var(--text); }
button.danger { color: var(--danger); }
button.danger:hover { color: #a62620; background: #fff0ef; }
button.destructive { background: var(--danger); color: white; }
button.destructive:hover { background: #a62620; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, textarea { appearance: none; width: 100%; min-width: 0; padding: 10px 12px; min-height: 40px; border: 1px solid transparent; border-radius: 8px; background: #ededf0; color: var(--text); font-size: 13px; }
input::placeholder, textarea::placeholder { color: #77777d; opacity: 1; }
input:focus, textarea:focus { border-color: var(--accent); background: #fff; }
input[type=search]::-webkit-search-cancel-button { display: none; }
textarea { min-height: 100px; resize: vertical; }
label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
p { line-height: 1.5; }
.hint { color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 20; padding: 12px; background: var(--surface); color: var(--accent); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
header { display: flex; justify-content: space-between; align-items: center; min-height: 72px; gap: 16px; border-bottom: 1px solid #e8e8ed; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -.4px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
#refresh { background: transparent; color: var(--accent); }
h1 { margin: 0; font-size: clamp(32px, 3.5vw, 48px); font-weight: 600; letter-spacing: -1.8px; line-height: 1.1; }
#feedback { margin: 0 0 16px; color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
#feedback.error { color: var(--danger); padding: 12px 16px; background: #fff0ef; border-radius: 10px; }
.project-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 24px 0 0; }
.project-filter-field { flex: 0 1 220px; min-width: 160px; }
.project-filter-field .picker-trigger { background: #f5f5f7; min-height: 44px; }
.filter-chip[aria-pressed=true] { color: #0062cc; background: #e1edff; }
#manage-projects { color: var(--accent); }
#manage-projects:hover { background: #edf5ff; }
.project-notice { flex-basis: 100%; margin: 0; padding-top: 10px; border-top: 1px solid var(--border); }
.board-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px 2px; }
.board-caption p { margin: 0; overflow-wrap: anywhere; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 20px; }
.column { min-width: 0; min-height: 420px; padding: 18px; border-radius: 18px; background: var(--column); display: flex; flex-direction: column; }
h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.2px; }
.column > h2 { margin-bottom: 18px; }
.column-window { margin-left: 2px; font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.count { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cards { display: grid; gap: 10px; margin-bottom: 20px; }
.ticket { min-width: 0; padding: 14px; border: 1px solid #e8e8ed; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 6px #00000004; transition: box-shadow 140ms, border-color 140ms; }
.ticket:hover { border-color: #c9c9d0; box-shadow: 0 4px 14px #00000008; }
.ticket[aria-busy=true] { border-color: #85b9ff; }
.ticket-header { display: flex; align-items: start; gap: 6px; }
.ticket-heading { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; margin: 0; }
button.ticket-title { width: 100%; padding: 2px 0; text-align: left; color: var(--text); background: transparent; font-size: 14px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
button.ticket-title:hover { color: var(--accent); }
.blocked-indicator { display: inline-flex; align-items: center; flex: none; color: var(--muted); }
.blocked-indicator svg { width: 14px; height: 14px; }
button svg { width: 16px; height: 16px; flex: none; stroke-width: 1.7; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 8px; }
.ticket-menu { position: relative; flex: none; margin-left: auto; }
.ticket-menu-trigger svg { width: 18px; height: 18px; stroke-width: 2.5; }
.ticket-menu:has(.ticket-menu-trigger[aria-expanded=true]) { z-index: 5; }
.ticket-menu-items { position: absolute; z-index: 5; right: 0; top: calc(100% + 4px); width: 240px; max-width: calc(100vw - 48px); padding: 8px; border: 1px solid #d2d2d780; border-radius: 12px; background: #fafafaf5; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 12px 36px #0000001f, 0 1px 4px #0000000a; }
.ticket-menu-items > button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; text-align: left; font-size: 12px; }
.ticket-reference { margin: 0; padding: 4px 8px 8px; font-size: 10px; color: var(--muted); }
.ticket-project-field { padding: 6px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid #e8e8ed; }
.ticket-project-field label { font-size: 11px; }
.ticket-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.project-badge { flex: 0 1 auto; min-width: 0; width: fit-content; max-width: 100%; margin: 0; padding: 0; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-badge.unassigned { color: var(--muted); background: transparent; padding-left: 0; }
.ticket-moves { display: flex; flex: none; gap: 4px; }
.ticket-moves button { background: #f5f5f7; color: var(--muted); }
.ticket-moves button:hover { background: #e5efff; color: var(--accent); }
.blocker-section:not(:empty) { margin-top: 12px; }
button.blocker-summary { display: block; width: 100%; padding: 8px; text-align: left; background: #fff8e8; color: #825700; }
button.blocker-summary:hover { background: #fff1ce; }
.blocker-label { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 600; }
.blocker-preview { display: block; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 12px; font-weight: 400; line-height: 1.5; }
button.unblock-action { color: var(--teal); }
.inline-editor { min-width: 0; margin: 8px 0 0; }
.ticket-header > .inline-editor { flex: 1; margin: 0; }
.inline-editor textarea { min-height: 70px; font-size: 14px; line-height: 1.45; }
.inline-editor .hint { margin: 8px 0; font-size: 10px; }
.inline-actions { display: flex; gap: 6px; margin-top: 8px; }
.inline-actions button { font-size: 12px; }
.ticket-feedback { margin: 10px 0 0; color: var(--teal); font-size: 11px; overflow-wrap: anywhere; white-space: pre-wrap; }
.ticket-feedback:empty { display: none; }
.ticket-feedback.error, .create-error { color: var(--danger); }
.create-form { margin-top: auto; padding-top: 16px; border-top: 1px solid #dedee3; }
.create-controls { display: flex; gap: 8px; }
.create-controls input { flex: 1; background: #fff; }
.create-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px; }
.create-project-label { margin: 12px 0 6px; font-size: 11px; }
.create-form .hint { margin: 8px 0 0; font-size: 10px; }
.create-error { margin: 8px 0 0; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 76px; padding: 16px; color: var(--muted); text-align: center; }
.empty strong { font-size: 12px; font-weight: 500; }
.board-help { margin-top: 24px; padding-top: 16px; border-top: 1px solid #e8e8ed; color: var(--muted); font-size: 11px; }
.board-help summary { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 36px; cursor: pointer; list-style: none; }
.board-help summary::-webkit-details-marker { display: none; }
.board-help summary::before { content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.board-help[open] summary::before { transform: rotate(45deg); }
.board-help p { max-width: 720px; }
project-picker { display: block; min-width: 0; width: 100%; }
.picker-trigger { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 10px 12px; border: 1px solid transparent; background: #fff; color: var(--text); text-align: left; font-size: 13px; font-weight: 400; }
.picker-trigger:hover { background: #f0f0f4; }
.picker-trigger[aria-expanded=true] { border-color: var(--accent); }
.picker-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-chevron { width: 6px; height: 6px; margin: 0 3px 3px 0; flex: none; border-bottom: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: rotate(45deg); }
.picker-list { position: fixed; inset: auto; margin: 0; padding: 5px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #d2d2d780; border-radius: 10px; background: #fafafaf5; color: var(--text); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 12px 36px #00000026, 0 1px 4px #0000000a; }
.picker-list::backdrop { background: transparent; }
.picker-option { position: relative; padding: 10px 28px 10px 12px; border-radius: 6px; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; cursor: pointer; }
.picker-option.active, .picker-option:hover { background: var(--accent); color: #fff; }
.picker-option[aria-selected=true]::after { content: ''; position: absolute; right: 12px; top: 14px; width: 5px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 0; border-radius: 24px; background: #f2f2f7f7; color: var(--text); box-shadow: 0 24px 80px #0003, 0 2px 8px #00000014; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
dialog::backdrop { background: #00000038; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
dialog h2 { font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
button.dialog-close { background: #e5e5ea; border-radius: 50%; color: var(--muted); font-size: 22px; line-height: 1; }
dialog p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
dialog label { margin: 20px 0 8px; }
dialog input { border-radius: 0; background: transparent; border: 0; border-bottom: 1px solid var(--border); padding-inline: 0; }
dialog input:focus { background: transparent; box-shadow: 0 1px 0 var(--accent); }
#project-form { margin-top: 18px; }
#delete-project { margin-right: auto; }
.project-actions, .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.project-feedback { color: var(--teal); font-size: 12px; white-space: pre-wrap; }
.project-feedback:empty { display: none; }
.project-feedback.error { color: var(--danger); }

.search-field { flex: 1 1 300px; min-width: 0; }
.search-input { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 1px solid transparent; border-radius: 12px; background: #f2f2f7; transition: background-color 140ms, border-color 140ms, box-shadow 140ms; }
.search-input:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px #007aff20; }
.search-icon { width: 19px; height: 19px; flex: none; color: #77777d; }
.search-input input { flex: 1; width: 0; min-height: 46px; padding: 10px 0; background: transparent; border: 0; border-radius: 0; font-size: 15px; }
.search-input input:focus { background: transparent; outline: 0; box-shadow: none; }
.search-input:has(input:disabled) { opacity: .55; }
#search-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
#clear-search { width: 28px; min-width: 28px; height: 28px; min-height: 28px; flex: none; border-radius: 50%; background: #e5e5ea; color: #63636a; }
#clear-search:hover { background: #d5d5dd; color: var(--text); }
#clear-search svg { width: 16px; height: 16px; }
#search-shortcut { position: static; transform: none; padding: 3px 6px; border: 1px solid #d2d2d7; border-radius: 5px; color: var(--muted); font: inherit; font-size: 10px; white-space: nowrap; pointer-events: none; }
mark { background: #fff1a8; color: inherit; border-radius: 2px; padding: 0; }
#feedback.sr-only { margin: -1px; }
#project-summary { font-size: 12px; }
#clear-filters { min-height: 32px; padding: 4px 8px; font-size: 11px; color: var(--accent); flex: none; }

@media (min-width: 801px) and (max-width: 1100px) {
    main { padding-inline: 24px; }
    .board { gap: 12px; }
    .column { padding: 12px; }
    .ticket { padding: 12px; }
    .create-controls { flex-wrap: wrap; }
    .create-controls input { flex-basis: 100%; }
}
@media (max-width: 800px) {
    main { padding: 0 16px 24px; }
    header { min-height: 64px; gap: 8px; }
    h1 { font-size: 32px; letter-spacing: -1px; }
    .project-toolbar { padding: 18px 0 0; gap: 10px; }
    .project-filter-field { flex: 1; max-width: none; }
    .search-field { flex-basis: 100%; }
    input, textarea, .picker-trigger, .inline-editor textarea { font-size: 16px; min-height: 44px; }
    .board { grid-template-columns: 1fr; }
    .column { min-height: 280px; }
    .search-input input { font-size: 16px; }
    #clear-search { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
    .icon-button { width: 40px; height: 40px; min-height: 40px; }
    .ticket-moves .icon-button { width: 44px; height: 44px; }
    .picker-option { min-height: 44px; display: flex; align-items: center; }
    .picker-option[aria-selected=true]::after { top: 16px; }
    dialog { padding: 24px; }
}
@media (any-pointer: coarse) {
    button { min-height: 44px; }
    .icon-button { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

.auth-panel { width: 100%; max-width: 380px; margin: 64px auto; }
.auth-panel h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.6px; }
.auth-panel > .hint { margin: 0 0 24px; }
.auth-panel form { display: grid; gap: 12px; }
.auth-panel label { margin: 8px 0 -4px; }
.auth-panel form .hint { margin: 0; }
#auth-feedback { font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
#auth-feedback:empty { display: none; }
#auth-submit { margin-top: 12px; }
.account-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
@media (max-width: 600px) {
    .auth-panel { margin: 40px auto; }
    .header-actions { gap: 2px; }
    .account-email { display: none; }
}

.portfolio-banner { margin: 0; padding: 0; width: 100%; background: #222; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-align: center; }
.portfolio-banner a { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 10px 20px; color: #fff; background: transparent; text-decoration: none; }
.portfolio-banner a:hover { background: #333; text-decoration: underline; }
.portfolio-banner a:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
