:root {
  --ink: #111827;
  --ink-2: #1d2939;
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d0d5dd;
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --lime: #9ef01a;
  --lime-dark: #5c940d;
  --blue: #4263eb;
  --coral: #f0655b;
  --violet: #845ef7;
  --green: #0ca678;
  --project-color: #4263eb;
  --status-color: #667085;
  --task-indent: 0px;
  --value: 0;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 12px rgba(16, 24, 40, 0.04);
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.14);
  font-family: Inter, "Noto Sans Thai", "Leelawadee UI", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); color: var(--ink); }
body { min-height: 100vh; margin: 0; font-size: 1rem; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img, svg { max-width: 100%; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; left: 1rem; top: -5rem; padding: .75rem 1rem; border-radius: 8px; background: var(--lime); color: var(--ink); font-weight: 800; }
.skip-link:focus { top: 1rem; }

.app-shell { background: var(--canvas); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; width: 268px; flex-direction: column; background: var(--ink); color: #fff; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; min-height: 88px; padding: 1.25rem 1.35rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--lime); color: var(--ink); font-weight: 900; letter-spacing: -.08em; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font-size: 1.05rem; letter-spacing: .08em; }
.brand-copy small { margin-top: .35rem; color: #98a2b3; font-size: .7rem; font-weight: 800; letter-spacing: .18em; }
.sidebar-close { display: none; border: 0; background: transparent; color: #fff; font-size: 1.75rem; }
.primary-nav { display: grid; gap: .3rem; padding: .7rem .85rem; }
.primary-nav a, .project-nav a { display: flex; align-items: center; border-radius: 10px; color: #c7ceda; font-weight: 650; }
.primary-nav a { gap: .8rem; min-height: 46px; padding: .7rem .85rem; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { background: rgba(255,255,255,.09); color: #fff; }
.primary-nav a[aria-current="page"] { box-shadow: inset 3px 0 var(--lime); }
.nav-icon { display: grid; width: 25px; place-items: center; color: var(--lime); font-size: 1.1rem; }
.sidebar-section { min-height: 0; flex: 1; padding: 1.1rem .85rem; overflow-y: auto; }
.sidebar-section-title { display: flex; align-items: center; justify-content: space-between; padding: 0 .85rem .7rem; color: #98a2b3; font-size: .76rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-section-title a { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #d0d5dd; font-size: 1.15rem; }
.sidebar-section-title a:hover { background: rgba(255,255,255,.1); color: #fff; }
.project-nav { display: grid; gap: .2rem; }
.project-nav a { display: grid; min-height: 43px; grid-template-columns: 10px 1fr auto; gap: .7rem; padding: .55rem .85rem; }
.project-nav a:hover, .project-nav a[aria-current="page"] { background: rgba(255,255,255,.07); color: #fff; }
.project-nav small { color: #7f899a; font-size: .72rem; font-weight: 800; }
.project-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-nav-owner { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; font-weight: 550; }
.project-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--project-color); }
.sidebar-empty { display: block; padding: .6rem .85rem; color: #7f899a; font-size: .78rem; line-height: 1.5; }
.sidebar-footer { padding: 1rem 1.1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.09); }
.portal-link { display: flex; align-items: center; gap: .65rem; margin-bottom: .85rem; padding: .6rem .4rem; color: #c7ceda; font-size: .85rem; font-weight: 700; }
.portal-link:hover { color: #fff; }
.sidebar-user { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: .7rem; align-items: center; }
.avatar, .mini-avatar { display: grid; place-items: center; border-radius: 50%; background: #dbe4ff; color: #364fc7; font-weight: 850; }
.avatar { width: 38px; height: 38px; font-size: .78rem; }
.user-copy { min-width: 0; display: flex; flex-direction: column; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: .84rem; }
.user-copy small { color: #98a2b3; font-size: .68rem; }
.footer-actions { display: flex; gap: 1rem; margin: .65rem 0 0 3rem; }
.footer-actions a, .footer-actions button { border: 0; padding: 0; background: transparent; color: #98a2b3; font-size: .73rem; }
.footer-actions a:hover, .footer-actions button:hover { color: #fff; }
.workspace-main { min-height: 100vh; margin-left: 268px; }
.mobile-bar, .sidebar-scrim { display: none; }

.page-wrap { width: min(1480px, 100%); margin: 0 auto; padding: 2.2rem clamp(1.25rem, 3vw, 3.25rem) 4rem; }
.page-header, .project-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.page-header { margin-bottom: 1.6rem; }
.page-header h1, .project-header h1 { margin: .15rem 0 0; font-size: clamp(1.75rem, 2.5vw, 2.5rem); line-height: 1.2; letter-spacing: -.035em; }
.page-header p { margin: .35rem 0 0; color: var(--muted); }
.eyebrow { color: var(--blue); font-size: .72rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: .7rem; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent; border-radius: 10px; padding: .62rem 1rem; font-weight: 800; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--ink); color: #fff; box-shadow: 0 5px 16px rgba(17,24,39,.17); }
.button.primary:hover { background: #202a3b; box-shadow: 0 7px 20px rgba(17,24,39,.23); }
.button.ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.button.danger { border-color: #ffd8d5; background: #fff5f4; color: #c92a2a; }
.button.small { min-height: 36px; padding: .45rem .7rem; font-size: .72rem; }
.button.large { min-height: 52px; padding-inline: 1.35rem; }
.language-switch button { min-width: 46px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: .78rem; font-weight: 850; }
.language-switch button:hover { border-color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { display: flex; min-height: 112px; align-items: center; gap: 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.2rem; box-shadow: var(--shadow-sm); }
.stat-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 14px; font-size: 1.2rem; font-weight: 900; }
.stat-card.coral .stat-icon { background: #fff0ef; color: var(--coral); }
.stat-card.blue .stat-icon { background: #edf2ff; color: var(--blue); }
.stat-card.green .stat-icon { background: #e6fcf5; color: var(--green); }
.stat-card.violet .stat-icon { background: #f3f0ff; color: var(--violet); }
.stat-card div { display: flex; flex-direction: column; }
.stat-card strong { font-size: 1.75rem; line-height: 1; }
.stat-card div span { margin-top: .35rem; color: var(--muted); font-size: .84rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .7fr); gap: 1rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.focus-panel, .pulse-panel { padding: 1.25rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin: .1rem 0 0; font-size: 1.15rem; letter-spacing: -.02em; }
.section-heading > a { color: var(--blue); font-size: .82rem; font-weight: 800; }
.focus-list { display: grid; }
.focus-row { display: grid; grid-template-columns: 10px minmax(0,1fr) auto 64px; gap: .85rem; align-items: center; min-height: 66px; border-top: 1px solid var(--line); padding: .7rem .2rem; }
.focus-row:hover strong { color: var(--blue); }
.task-state { width: 9px; height: 9px; border: 2px solid var(--status-color); border-radius: 50%; }
.focus-copy { min-width: 0; display: flex; flex-direction: column; }
.focus-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.focus-copy small { color: var(--muted); font-size: .72rem; }
.priority { display: inline-flex; width: fit-content; align-items: center; border-radius: 999px; padding: .22rem .52rem; font-size: .7rem; font-weight: 850; white-space: nowrap; }
.priority-urgent { background: #fff0ef; color: #d94841; }
.priority-high { background: #fff4e6; color: #c65300; }
.priority-normal { background: #edf2ff; color: #364fc7; }
.priority-low { background: #f2f4f7; color: #667085; }
.due-date { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.due-date.overdue { color: #d92d20; font-weight: 800; }
.pulse-panel { background: var(--ink); color: #fff; }
.pulse-panel .eyebrow { color: var(--lime); }
.pulse-visual { display: grid; min-height: 190px; place-items: center; align-content: center; gap: 1rem; text-align: center; }
.pulse-ring { display: grid; width: 116px; height: 116px; place-items: center; border-radius: 50%; background: conic-gradient(var(--lime) calc(var(--value) * 1%), #303b4c 0); position: relative; }
.pulse-ring::after { position: absolute; width: 88px; height: 88px; border-radius: 50%; background: var(--ink); content: ""; }
.pulse-ring span { z-index: 1; font-size: 1.45rem; font-weight: 900; }
.pulse-visual > div:last-child { display: flex; flex-direction: column; }
.pulse-visual small { color: #98a2b3; font-size: .75rem; }
.empty-state { display: grid; place-items: center; padding: 2rem; text-align: center; color: var(--muted); }
.empty-state span { font-size: 1.8rem; }
.empty-state.compact { min-height: 120px; }

.projects-section { margin-top: 2rem; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.project-card { position: relative; display: flex; min-height: 230px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.2rem; box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s; }
.project-card::before { position: absolute; inset: 0 0 auto; height: 4px; background: var(--project-color); content: ""; }
.project-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16,24,40,.1); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; }
.project-badge { border-radius: 7px; background: color-mix(in srgb, var(--project-color) 12%, white); color: var(--project-color); padding: .25rem .5rem; font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
.project-card h3 { margin: 1rem 0 .3rem; font-size: 1.08rem; }
.project-owner { color: var(--muted); font-size: .66em; font-weight: 650; letter-spacing: 0; }
.project-card p { min-height: 48px; margin: 0; color: var(--muted); font-size: .82rem; }
.project-progress { margin-top: auto; }
.project-progress > span { display: block; height: 6px; overflow: hidden; border-radius: 99px; background: #edf0f4; }
.project-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--project-color); }
.project-progress small { display: block; margin-top: .35rem; color: var(--muted); font-size: .7rem; }
.project-card-meta { display: flex; justify-content: space-between; margin-top: .85rem; color: var(--muted); font-size: .74rem; }
.project-card-meta strong { color: var(--ink); }
.empty-project-card { min-height: 230px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255,255,255,.55); color: var(--muted); padding: 1.4rem; }
.empty-project-card span { display: grid; width: 42px; height: 42px; margin: 0 auto .8rem; place-items: center; border-radius: 12px; background: var(--ink); color: #fff; font-size: 1.3rem; }
.empty-project-card strong, .empty-project-card small { display: block; }
.empty-project-card strong { color: var(--ink); }
.empty-project-card small { margin-top: .3rem; }

.project-page { min-height: 100vh; overflow: hidden; }
.project-page-top { padding: 1.8rem clamp(1.2rem, 2.5vw, 2.5rem) 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.project-title-wrap { display: flex; align-items: center; gap: .9rem; }
.project-symbol { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 15px; background: var(--project-color); color: #fff; font-size: 1.25rem; font-weight: 900; }
.view-tabs { display: flex; align-items: center; gap: 1.4rem; min-height: 55px; margin-top: 1rem; border-top: 1px solid var(--line); }
.view-tabs a { display: flex; min-height: 55px; align-items: center; border-bottom: 3px solid transparent; color: var(--muted); font-size: .85rem; font-weight: 800; }
.view-tabs a[aria-current="page"] { border-color: var(--ink); color: var(--ink); }
.project-hint { margin-left: auto; color: var(--muted); font-size: .72rem; }
.filter-bar { display: flex; align-items: center; gap: .6rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.filter-bar.standalone { border: 0; padding: 0 0 1rem; }
.search-field { display: flex; min-width: 250px; align-items: center; gap: .45rem; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; padding: .42rem .65rem; color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: .85rem; }
.filter-bar select { min-height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink-2); padding: 0 2rem 0 .7rem; font-size: .8rem; }
.clear-filter { color: var(--blue); font-size: .78rem; font-weight: 800; }
.board { display: grid; grid-auto-columns: minmax(280px, 330px); grid-auto-flow: column; gap: .85rem; min-height: calc(100vh - 235px); overflow-x: auto; padding: 1.15rem clamp(1.2rem, 2.5vw, 2.5rem) 2rem; scroll-snap-type: x proximity; }
.board-column { min-height: 400px; scroll-snap-align: start; }
.board-column > header { display: flex; align-items: center; gap: .55rem; min-height: 40px; padding: 0 .3rem; }
.board-column > header h2 { margin: 0; font-size: .79rem; letter-spacing: .04em; text-transform: uppercase; }
.board-column > header b { margin-left: auto; border-radius: 99px; background: #e9edf3; color: var(--muted); padding: .05rem .48rem; font-size: .68rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--status-color); }
.task-stack { min-height: 360px; padding: .2rem; border-radius: 14px; transition: background .15s, box-shadow .15s; }
.task-stack.drag-over { background: #e9efff; box-shadow: inset 0 0 0 2px #91a7ff; }
.task-card { position: relative; display: block; margin: 0 0 .65rem var(--task-indent, 0); border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: .9rem; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, opacity .15s, border-color .15s; }
.task-card.child-task { border-left: 3px solid #91a7ff; }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,.09); }
.task-card.dragging { opacity: .45; transform: rotate(1deg); }
.task-card.parent-drop { border-color: var(--blue); box-shadow: 0 0 0 3px #dbe4ff; transform: translateY(-2px); }
.task-card.drop-before::before, .task-card.drop-after::after { position: absolute; right: 0; left: 0; height: 3px; border-radius: 99px; background: var(--blue); content: ""; }
.task-card.drop-before::before { top: -6px; }
.task-card.drop-after::after { bottom: -6px; }
.task-card[draggable="true"] { cursor: grab; }
.task-card[draggable="true"]:active { cursor: grabbing; }
.task-reference { color: var(--muted); font-size: .66rem; font-weight: 850; letter-spacing: .06em; }
.task-parent-line { display: block; overflow: hidden; margin-bottom: .25rem; color: var(--blue); font-size: .64rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.task-card > strong { display: block; margin-top: .32rem; font-size: .9rem; line-height: 1.4; }
.task-card > p { margin: .4rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.task-card-meta { display: flex; align-items: center; gap: .45rem; margin-top: .85rem; }
.task-card-meta .due-date { margin-left: auto; }
.subtask-count { color: var(--blue); font-size: .67rem; font-weight: 800; white-space: nowrap; }
.mini-avatar { width: 27px; height: 27px; flex: 0 0 27px; font-size: .58rem; }
.mini-avatar.empty { background: #f2f4f7; color: #98a2b3; }
.mini-avatar.external { background: #fff1e6; color: #c2410c; }
.column-empty { display: grid; min-height: 90px; place-items: center; border: 1px dashed #d8dde6; border-radius: 12px; color: #98a2b3; font-size: .73rem; }

.list-page .project-page-top { padding-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.project-page.list-page .table-wrap { margin: 1.2rem clamp(1.2rem, 2.5vw, 2.5rem) 3rem; }
.task-table { width: 100%; border-collapse: collapse; text-align: left; }
.task-table th { border-bottom: 1px solid var(--line); background: #fafbfc; color: var(--muted); padding: .75rem 1rem; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.task-table td { border-bottom: 1px solid var(--line); padding: .8rem 1rem; font-size: .8rem; vertical-align: middle; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table tbody tr:hover { background: #fafbff; }
.task-table td:first-child { min-width: 280px; }
.task-table td:first-child a { display: flex; flex-direction: column; }
.task-tree-link { padding-left: var(--task-indent, 0); }
.task-table td:first-child small { color: var(--muted); font-size: .65rem; }
.task-table td:first-child strong { font-size: .86rem; }
.status-pill { display: inline-flex; align-items: center; gap: .4rem; border-radius: 99px; background: color-mix(in srgb, var(--status-color) 12%, white); color: color-mix(in srgb, var(--status-color) 82%, black); padding: .24rem .55rem; font-size: .7rem; font-weight: 850; white-space: nowrap; }
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: var(--status-color); content: ""; }
.person { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.muted { color: var(--muted); }

.task-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: 1rem; color: var(--muted); font-size: .8rem; }
.task-breadcrumb a { font-weight: 800; color: var(--ink); }
.task-breadcrumb .task-members-link { border: 1px solid var(--line-strong); border-radius: 8px; padding: .35rem .6rem; }
.task-breadcrumb .task-members-link:hover, .task-breadcrumb .task-members-link:focus-visible { border-color: var(--blue); color: var(--blue); }
.task-breadcrumb .language-switch { margin-left: auto; }
.task-detail-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(300px,.7fr); gap: 1rem; align-items: start; }
.task-editor { padding: clamp(1.2rem, 2.5vw, 2rem); }
.task-title-block { margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); padding-bottom: 1.2rem; }
.task-title-block .priority { margin-left: .35rem; }
.task-title-block h1 { margin: .9rem 0 .25rem; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.3; letter-spacing: -.03em; }
.task-title-block p { margin: 0; color: var(--muted); font-size: .75rem; }
.recurrence-summary { margin: -.55rem 0 1.15rem; }
.recurrence-pill { display: inline-flex; align-items: center; border: 1px solid #dbe4ff; border-radius: 999px; background: #f2f5ff; color: #364fc7; padding: .25rem .62rem; font-size: .72rem; font-weight: 800; }
.recurrence-indicator { display: inline-grid; width: 1.2rem; height: 1.2rem; place-items: center; margin-left: .15rem; border-radius: 50%; background: #edf2ff; color: #364fc7; font-size: .9rem; font-weight: 900; line-height: 1; vertical-align: middle; }
.task-parent-path { display: flex; overflow-x: auto; align-items: center; gap: .35rem; margin-bottom: .8rem; color: var(--muted); font-size: .69rem; white-space: nowrap; }
.task-parent-path a { color: var(--blue); font-weight: 750; }
.task-side { display: grid; gap: 1rem; }
.comments-panel, .task-meta { padding: 1.15rem; }
.comment-list { display: grid; gap: 1rem; }
.comment { display: grid; grid-template-columns: 36px 1fr; gap: .65rem; }
.comment header { display: flex; justify-content: space-between; gap: 1rem; }
.comment header strong { font-size: .78rem; }
.comment header time { color: var(--muted); font-size: .68rem; }
.comment p { margin: .3rem 0 0; color: var(--ink-2); font-size: .82rem; }
.comment-form { display: grid; gap: .65rem; margin-top: 1.2rem; }
.comment-form textarea { width: 100%; resize: vertical; border: 1px solid var(--line-strong); border-radius: 10px; padding: .7rem; }
.comment-form .button { justify-self: end; }
.task-meta h2 { margin: 0 0 .8rem; font-size: 1rem; }
.task-meta dl, .task-meta dl div { margin: 0; }
.task-meta dl { display: grid; gap: .7rem; }
.task-meta dl div { display: flex; justify-content: space-between; gap: 1rem; font-size: .74rem; }
.subtask-list { display: grid; gap: .45rem; }
.subtask-list a { display: grid; gap: .12rem; border: 1px solid var(--line); border-radius: 9px; padding: .55rem .65rem; }
.subtask-list a:hover { border-color: #91a7ff; background: #f7f9ff; }
.subtask-list span { color: var(--muted); font-size: .65rem; font-weight: 800; }
.subtask-list strong { color: var(--ink); font-size: .76rem; }
.task-meta dt { color: var(--muted); }
.task-meta dd { margin: 0; text-align: right; }
.toast-message { margin-bottom: 1rem; border: 1px solid #96f2d7; border-radius: 10px; background: #e6fcf5; color: #087f5b; padding: .65rem .85rem; font-size: .8rem; font-weight: 800; }
.toast-message.error { border-color: #ffc9c5; background: #fff5f4; color: #c92a2a; }
.board-toast { margin: 1rem clamp(1.2rem, 2.5vw, 2.5rem) 0; }

.members-content { width: min(1180px, calc(100% - 2.4rem)); margin: 0 auto; padding: 1.5rem 0 3rem; }
.members-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.members-heading h2 { margin: .2rem 0 0; font-size: 1.5rem; }
.members-heading p { margin: .35rem 0 0; color: var(--muted); font-size: .82rem; }
.member-total { border-radius: 99px; background: #edf2ff; color: #364fc7; padding: .35rem .7rem; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.members-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.6fr); gap: 1rem; align-items: start; }
.members-layout > * { min-width: 0; }
.member-add-card, .member-list-card { padding: 1.2rem; }
.member-add-card > p { margin: 0 0 .75rem; font-size: .78rem; }
.member-add-form { display: grid; }
.member-add-form .button { justify-self: end; }
.member-invite-section { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1.1rem; }
.member-invite-section > p { margin: .2rem 0 .8rem; font-size: .78rem; }
.pending-invitations { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: .8rem; }
.pending-invitations h3 { margin: 0 0 .5rem; font-size: .85rem; }
.pending-invitation { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.pending-invitation strong, .pending-invitation small { display: block; overflow-wrap: anywhere; }
.pending-invitation small { color: var(--muted); font-size: .7rem; }
.pending-invitation .button { white-space: nowrap; }
.member-empty { border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); padding: 1rem; font-size: .76rem; line-height: 1.6; }
.member-list-card.full { grid-column: 1 / -1; }
.member-list { display: grid; }
.member-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 1rem; align-items: center; min-height: 74px; border-bottom: 1px solid var(--line); padding: .7rem 0; }
.member-row:first-child { padding-top: 0; }
.member-row:last-child { border-bottom: 0; padding-bottom: 0; }
.member-identity { min-width: 0; display: flex; align-items: center; gap: .7rem; }
.member-identity > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.member-identity strong, .member-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-identity strong { font-size: .82rem; }
.member-identity small { color: var(--muted); font-size: .68rem; }
.you-badge { display: inline; border-radius: 99px; background: #edf2ff; color: #364fc7 !important; padding: .1rem .35rem; font-weight: 850; }
.member-actions, .role-form { display: flex; align-items: center; gap: .45rem; }
.role-form select { min-height: 36px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); padding: 0 1.8rem 0 .6rem; font-size: .74rem; }
.member-role-summary { display: flex; align-items: center; gap: .55rem; }
.role-badge { border-radius: 99px; background: #f2f4f7; color: var(--ink-2); padding: .27rem .55rem; font-size: .68rem; font-weight: 850; }
.role-owner { background: #fff4e6; color: #b54708; }
.role-manager { background: #f3f0ff; color: #6741d9; }
.role-member { background: #edf2ff; color: #364fc7; }
.role-viewer { background: #f2f4f7; color: #667085; }
.owner-lock { color: var(--muted); font-size: .67rem; white-space: nowrap; }
.member-security-note { margin: 1rem 0 0; border-top: 1px solid var(--line); padding-top: .8rem; color: var(--muted); font-size: .7rem; }

.app-dialog { width: min(540px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; border: 0; border-radius: 20px; padding: 0; box-shadow: var(--shadow); }
.app-dialog.wide { width: min(760px, calc(100% - 2rem)); }
.app-dialog::backdrop { background: rgba(17,24,39,.56); backdrop-filter: blur(3px); }
.dialog-form { padding: 1.35rem; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.2rem; }
.dialog-heading h2 { margin: .15rem 0 0; font-size: 1.35rem; }
.dialog-heading button { border: 0; background: transparent; color: var(--muted); font-size: 1.7rem; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.form-field { display: grid; gap: .35rem; margin-bottom: .9rem; color: var(--ink-2); font-size: .78rem; font-weight: 750; }
.form-grid .form-field { margin: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); padding: .65rem .7rem; outline: 0; font-size: .85rem; font-weight: 500; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .comment-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #dbe4ff; }
.form-field textarea { resize: vertical; }
.form-field input[type="color"] { width: 60px; height: 42px; padding: .25rem; }
.form-field small { color: var(--muted); font-size: .68rem; font-weight: 500; }
.form-field em, .form-error { color: #d92d20; font-size: .7rem; font-style: normal; }
.dialog-actions, .form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1rem; }

.overview-search, .global-search-form { display: flex; align-items: center; gap: .65rem; margin: 0 0 1.25rem; }
.overview-search label { flex: 1; }
.overview-search input, .global-search-form input, .checklist-add input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: .7rem .85rem; color: var(--ink); font: inherit; }
.global-search-form { padding: 1rem; }
.global-search-form input[type="search"] { flex: 1 1 360px; }
.global-search-form input[name="tag"] { flex: 0 1 210px; }
.search-results-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; align-items: start; }
.search-result-section { padding: 1rem; }
.search-result-item { border-top: 1px solid var(--line); padding: .8rem 0; }
.search-result-item:first-of-type { border-top: 0; }
.search-result-item > a { display: grid; gap: .3rem; color: inherit; text-decoration: none; }
.search-result-item strong { line-height: 1.45; }
.search-result-item small { color: var(--muted); }
.hashtag-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.hashtag-row a, .hashtag-link { color: #3157d5; font-weight: 800; text-decoration: none; }
.visibility-pill { display: inline-flex; align-items: center; margin-left: .35rem; border-radius: 999px; padding: .32rem .6rem; background: #f2f4f7; color: #475467; font-size: .68rem; font-weight: 900; }
.visibility-pill.visibility-public { background: #e6f7ef; color: #067647; }
.checklist-list, .reminder-list { display: grid; gap: .55rem; }
.checklist-row, .reminder-row { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .7rem; background: #fff; }
.checklist-row > span:nth-child(2), .reminder-row > div { flex: 1; }
.checklist-row.is-complete > span:nth-child(2) { color: var(--muted); text-decoration: line-through; }
.checklist-toggle, .icon-delete { border: 0; background: transparent; color: #475467; font-size: 1.05rem; cursor: pointer; }
.checklist-add { display: flex; gap: .5rem; margin-top: .75rem; }
.reminder-row div { display: grid; gap: .2rem; }
.reminder-row small { color: var(--muted); }
.reminder-form { display: grid; gap: .6rem; margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.reminder-form > small { color: var(--muted); line-height: 1.5; }
.reminder-inbox { margin-bottom: 1.25rem; padding: 1rem; }

.public-shell { background: var(--ink); color: #fff; }
.landing-wrap { width: min(1500px, 100%); min-height: 100vh; margin: 0 auto; padding: 1.5rem clamp(1.25rem, 4vw, 4rem) 2rem; }
.landing-header { display: flex; align-items: center; justify-content: space-between; }
.landing-header .language-switch button { border-color: #475467; background: transparent; color: #fff; }
.landing-panel { display: grid; min-height: calc(100vh - 112px); grid-template-columns: minmax(340px,.85fr) minmax(460px,1.15fr); gap: clamp(2rem, 6vw, 7rem); align-items: center; }
.landing-copy { max-width: 620px; }
.landing-copy .eyebrow { color: var(--lime); }
.landing-copy h1 { margin: .8rem 0 1rem; font-size: clamp(2.8rem, 6vw, 5.9rem); line-height: .99; letter-spacing: -.065em; }
.landing-copy p { max-width: 560px; margin: 0 0 1.8rem; color: #b8c0cc; font-size: clamp(1rem, 1.4vw, 1.2rem); }
.landing-copy .button { background: var(--lime); color: var(--ink); box-shadow: none; }
.landing-copy > small { display: block; margin-top: .85rem; color: #7f899a; font-size: .72rem; }
.landing-preview { position: relative; transform: rotate(-1.5deg); overflow: hidden; border: 1px solid #394557; border-radius: 24px; background: #f3f5f9; box-shadow: 0 50px 100px rgba(0,0,0,.35); color: var(--ink); }
.landing-preview::after { position: absolute; inset: -25% -10% auto auto; width: 260px; height: 260px; border-radius: 50%; background: rgba(158,240,26,.25); filter: blur(65px); content: ""; }
.preview-top { display: flex; min-height: 76px; align-items: center; gap: .4rem; border-bottom: 1px solid #dde2ea; background: #fff; padding: 0 1.2rem; }
.preview-top span { width: 9px; height: 9px; border-radius: 50%; background: #d0d5dd; }
.preview-top span:first-child { background: var(--coral); }
.preview-top strong { margin-left: 1rem; font-size: .9rem; }
.preview-grid { display: grid; min-height: 460px; grid-template-columns: repeat(3,1fr); gap: .7rem; padding: 1.2rem; }
.preview-column { border-radius: 14px; background: #e8ebf1; padding: .85rem; }
.preview-column.active { transform: translateY(20px); background: #e9efff; }
.preview-column b { color: #667085; font-size: .63rem; letter-spacing: .08em; }
.preview-column i { display: block; height: 100px; margin-top: .75rem; border: 1px solid #e1e4e9; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.preview-column i::before { display: block; width: 70%; height: 7px; margin: 1rem; border-radius: 99px; background: #d5dae2; content: ""; box-shadow: 0 18px 0 #e6e9ee, 0 48px 0 #dbe4ff; }
.preview-column i.short { height: 78px; }

.error-page { display: grid; min-height: 100vh; place-items: center; align-content: center; gap: 1rem; padding: 2rem; text-align: center; }
.error-code { color: var(--lime); font-size: clamp(3rem, 9vw, 7rem); font-weight: 950; line-height: 1; }
.error-page h1 { max-width: 760px; margin: 0; font-size: clamp(1.5rem, 4vw, 2.7rem); }
.error-page p { max-width: 620px; margin: 0; color: #aab2bf; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .landing-panel { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .task-detail-grid { grid-template-columns: 1fr; }
  .task-side { grid-template-columns: 1fr 1fr; }
  .members-layout { grid-template-columns: 1fr; }
  .member-list-card.full { grid-column: auto; }
  .search-results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .mobile-bar { position: sticky; top: 0; z-index: 40; display: flex; min-height: 62px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); padding: .7rem 1rem; backdrop-filter: blur(12px); }
  .mobile-bar .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: .72rem; }
  .mobile-bar .avatar { width: 32px; height: 32px; }
  .icon-button { display: grid; width: 38px; height: 38px; place-content: center; gap: 4px; border: 0; border-radius: 9px; background: #f2f4f7; }
  .icon-button span { width: 17px; height: 2px; border-radius: 99px; background: var(--ink); }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-scrim { position: fixed; inset: 0; z-index: 45; display: block; background: rgba(17,24,39,.55); }
  .sidebar-close { display: block; }
  .workspace-main { margin-left: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .project-hint { display: none; }
  .landing-panel { min-height: calc(100vh - 100px); grid-template-columns: 1fr; padding: 3rem 0; }
  .landing-preview { display: none; }
  .landing-copy { max-width: 700px; }
}

@media (max-width: 620px) {
  .page-wrap { padding: 1.4rem 1rem 3rem; }
  .page-header, .project-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; justify-content: space-between; }
  .stat-grid, .project-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 92px; }
  .overview-search, .global-search-form { align-items: stretch; flex-direction: column; }
  .global-search-form input[name="tag"] { width: 100%; flex-basis: auto; }
  .focus-row { grid-template-columns: 8px minmax(0,1fr) auto; }
  .focus-row .due-date { display: none; }
  .project-page-top { padding: 1.15rem 1rem 0; }
  .project-title-wrap h1 { font-size: 1.45rem; }
  .project-symbol { width: 42px; height: 42px; border-radius: 12px; }
  .view-tabs { gap: 1.1rem; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; }
  .filter-bar select { width: 100%; }
  .board { display: block; min-height: 0; overflow: visible; padding: 1rem; }
  .board-column { min-height: 0; margin-bottom: 1.35rem; }
  .task-stack { min-height: 90px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .task-side { grid-template-columns: 1fr; }
  .task-editor { padding: 1.1rem; }
  .members-content { width: calc(100% - 2rem); padding-top: 1rem; }
  .members-heading, .member-row { align-items: flex-start; grid-template-columns: 1fr; }
  .members-heading { display: grid; }
  .member-total { width: fit-content; }
  .member-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .role-form { width: 100%; }
  .role-form label, .role-form select { width: 100%; }
  .member-actions > form:last-child .button { width: 100%; }
  .task-table th:nth-child(3), .task-table td:nth-child(3), .task-table th:nth-child(4), .task-table td:nth-child(4) { display: none; }
  .landing-wrap { padding: 1rem; }
  .landing-copy h1 { font-size: clamp(2.55rem, 13vw, 4rem); }
  .landing-header .brand-copy { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
