:root {
  color-scheme: light;
  --bg: #ffffff; --panel: #ffffff; --panel2: #f7f7f7; --line: #e8e8e8;
  --text: #222222; --muted: #6a6a6a; --accent: #d70466; --blue: #3163a2;
  --green: #16734c; --red: #c13515; --orange: #8b5c12; --radius: 24px;
  --accent-soft: #fff1f4; --blue-soft: #edf3fa; --green-soft: #edf7f1;
  --orange-soft: #fff8e9; --red-soft: #fff1ec; --input: #ffffff;
  --on-accent: #ffffff; --shadow: 0 6px 22px #00000008;
  --nav-bg: #fffffff5; --overlay: #22222266;
  --safe-top: calc(max(env(safe-area-inset-top, 0px), var(--app-safe-top, 0px)) + var(--app-content-top, 0px));
  --safe-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--app-safe-bottom, 0px)) + var(--app-content-bottom, 0px));
  --safe-left: calc(max(env(safe-area-inset-left, 0px), var(--app-safe-left, 0px)) + var(--app-content-left, 0px));
  --safe-right: calc(max(env(safe-area-inset-right, 0px), var(--app-safe-right, 0px)) + var(--app-content-right, 0px));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none; -webkit-text-size-adjust: 100%;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191919; --panel: #222222; --panel2: #2b2b2b; --line: #3d3d3d;
  --text: #f7f7f7; --muted: #b4b4b4; --accent: #ff809c; --blue: #9cbfe8;
  --green: #93d7b3; --red: #ffa68f; --orange: #f0cc87;
  --accent-soft: #422b33; --blue-soft: #283848; --green-soft: #273c32;
  --orange-soft: #41382a; --red-soft: #472d26; --input: #222222;
  --on-accent: #222222; --shadow: 0 6px 22px #00000018;
  --nav-bg: #222222f5; --overlay: #00000099;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--safe-top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(27px, 3.5vw, 36px); line-height: 1.2; letter-spacing: -1px; font-weight: 700; }
h2 { font-size: 19px; letter-spacing: -.3px; line-height: 1.4; }
h3 { font-size: 16px; line-height: 1.4; }
.icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.eyebrow { font-size: 10px; line-height: 1.5; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 650; overflow-wrap: anywhere; }
.row, .topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row { flex-wrap: wrap; }
.app-shell { width: 100%; max-width: 1260px; margin: auto; min-height: var(--app-viewport-height, 100dvh); padding: var(--safe-top) calc(32px + var(--safe-right)) 0 calc(32px + var(--safe-left)); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 86px; padding: 16px 0; border-bottom: 1px solid var(--line); gap: 16px; }
.topbar > .row { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 18px; font-weight: 700; letter-spacing: -.5px; white-space: nowrap; }
.brand-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; background: var(--accent); color: var(--on-accent); border-radius: 12px; }
.brand-icon .icon { width: 23px; height: 23px; }
.workspace-label { border-left: 1px solid var(--line); padding-left: 20px; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.user-name { max-width: 220px; overflow-wrap: anywhere; }
.avatar { width: 38px; height: 38px; flex: 0 0 auto; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 650; }
.nav { display: flex; gap: 28px; min-height: 64px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.nav button { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; padding: 14px 0; position: relative; min-height: 44px; }
.nav button.active { color: var(--accent); }
.nav button.active::after { content: ''; height: 2px; background: var(--accent); position: absolute; bottom: -1px; left: 0; right: 0; border-radius: 2px; }
.nav .icon { width: 18px; height: 18px; }
.main { padding-bottom: calc(40px + var(--safe-bottom)); min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; }
.page-heading > div { min-width: 0; }
.page-heading .eyebrow { margin-bottom: 8px; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 13px; max-width: 540px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); font-weight: 600; font-size: 13px; min-height: 44px; max-width: 100%; line-height: 1.4; overflow-wrap: anywhere; transition: background .15s; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.danger { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.btn.full { width: 100%; } .btn.text { background: none; }
.icon-button { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.mobile-label { display: none; }
.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.project-card { text-align: left; position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--panel); }
.project-card.active { border-color: var(--project); background: color-mix(in srgb, var(--project) 10%, var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--project) 18%, transparent); }
.project-mark { display: flex; align-items: center; gap: 8px; padding-right: 22px; font-size: 13px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.project-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--project); flex: 0 0 auto; }
.project-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px; font-size: 28px; letter-spacing: -.8px; font-weight: 650; margin-top: 16px; line-height: 1.2; }
.project-count span { font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.project-card .check { position: absolute; right: 14px; top: 17px; color: var(--project); line-height: 1; }
.project-card .check .icon { width: 16px; height: 16px; }
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat { display: flex; gap: 12px; align-items: center; min-width: 0; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; text-align: left; }
.stat > div { min-width: 0; }
.stat-icon { display: grid; place-items: center; flex: 0 0 auto; background: var(--blue-soft); color: var(--blue); width: 38px; height: 38px; border-radius: 11px; }
.stat-icon.orange { background: var(--orange-soft); color: var(--orange); } .stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat strong { display: block; font-size: 25px; line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }
.stat small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
.content-grid > *, .profile-grid > *, .form-row > *, .detail-meta > *, .task-list, .task-toolbar { min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 14px; gap: 12px; }
.section-head h2 { min-width: 0; }
.badge { font-size: 11px; border: 1px solid var(--line); padding: 4px 8px; border-radius: 7px; color: var(--muted); }
.task-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 16px; }
.tabs { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; gap: 4px; min-width: 0; }
.tabs button { min-width: 0; min-height: 38px; border-radius: 8px; color: var(--muted); font-size: 12px; padding: 7px 4px; line-height: 1.4; }
.tabs button.active { background: var(--accent-soft); color: var(--accent); }
.search { position: relative; min-width: 0; grid-row: 2; }
.search .icon { position: absolute; left: 13px; top: 14px; color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.search input { padding-left: 38px; }
.switch-row { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; margin: 0; grid-column: 2; grid-row: 2; padding: 8px 4px; }
.switch-row input { width: 18px; height: 18px; min-height: 0; padding: 0; flex: 0 0 auto; accent-color: var(--accent); }
.task-list { display: grid; gap: 12px; }
.task-card { display: block; width: 100%; min-width: 0; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 18px; }
.task-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.task-code { font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .4px; color: var(--muted); }
.priority { font-size: 11px; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.priority i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.priority.high { color: var(--orange); } .priority.critical { color: var(--red); }
.task-title { font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.task-description { font-size: 13px; color: var(--muted); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.task-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.task-footer span { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.task-footer .icon { width: 14px; height: 14px; }
.task-footer .late { color: var(--red); }
.task-footer .assignee { max-width: 100%; }
.side-stack { display: grid; gap: 14px; align-content: start; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow-wrap: anywhere; }
.panel h3 { margin-bottom: 12px; }
.panel .eyebrow { margin-bottom: 14px; }
.contact { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.contact > div { min-width: 0; }
.contact a { font-size: 13px; overflow-wrap: anywhere; }
.contact .avatar { border: 0; border-radius: 10px; width: 34px; height: 34px; font-size: 11px; }
.contact small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.tip { background: linear-gradient(135deg, var(--accent-soft), var(--blue-soft)); border-color: var(--line); }
.tip > .icon { color: var(--accent); margin-bottom: 12px; width: 24px; height: 24px; }
.tip p { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.tip .btn { margin-top: 16px; }
.mini-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; font-size: 12px; color: var(--muted); }
.mini-stat strong { min-width: 0; color: var(--text); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.mini-stat + .mini-stat { border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 38px 20px; border: 1px dashed var(--line); border-radius: 16px; }
.empty > .icon { width: 32px; height: 32px; color: var(--muted); margin-bottom: 14px; }
.empty h3 { margin-bottom: 8px; }
.empty p { font-size: 13px; color: var(--muted); max-width: 320px; margin: auto; }
.empty .btn { margin-top: 18px; }
.footer-note { font-size: 11px; color: var(--muted); display: flex; align-items: flex-start; gap: 7px; margin-top: 26px; }
.footer-note i { width: 5px; height: 5px; margin-top: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.loading-screen { min-height: 75dvh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; padding: 24px; text-align: center; }
.loading-screen p { color: var(--muted); font-size: 13px; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #2e293e; border-bottom: 1px solid #5a4874; padding: 8px 16px; color: #decafa; font-size: 11px; }
.demo-banner select { width: auto; max-width: 50%; padding: 6px; min-height: 32px; background: #201e2b; font-size: 12px; }
.center-card { width: calc(100% - 32px - var(--safe-left) - var(--safe-right)); max-width: 460px; margin: calc(40px + var(--safe-top)) auto; padding: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; }
.center-card h2 { margin: 20px 0 10px; }
.center-card p { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.center-card code { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 20px; overflow-wrap: anywhere; }
input, textarea, select { color: var(--text); background: var(--input); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; min-height: 46px; width: 100%; max-width: 100%; min-width: 0; outline: none; font-size: 16px; line-height: 1.4; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=date], input[type=datetime-local] { -webkit-appearance: none; appearance: none; }
textarea { resize: vertical; min-height: 120px; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 7px; color: var(--text); }
label > input { margin-top: 7px; }
.field { min-width: 0; margin-bottom: 18px; }
.field small, .field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.error-message { padding: 12px; background: var(--red-soft); color: var(--red); border: 1px solid var(--red); border-radius: 11px; font-size: 13px; margin-bottom: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.error-message:empty { display: none; }
body:has(dialog[open]) { overflow: hidden; }
/* Keep the native top-layer dialog stationary; only the inner surface animates. */
dialog { position: fixed; inset: var(--app-visual-top,0px) auto auto var(--app-visual-left,0px); margin: 0; width: var(--app-visible-width,100%); height: var(--app-visible-height,100dvh); max-width: none; max-height: none; padding: calc(var(--safe-top) + 16px) calc(var(--safe-right) + 20px) calc(var(--safe-bottom) + 16px) calc(var(--safe-left) + 20px); color: var(--text); background: transparent; border: 0; overflow: hidden; }
dialog[open] { display: flex; align-items: center; justify-content: center; }
.modal-surface { width: 100%; max-width: 620px; min-width: 0; max-height: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 22px; overflow: auto; overscroll-behavior: contain; box-shadow: 0 24px 80px #0009; }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(5px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.modal-head h2 { font-size: 18px; min-width: 0; }
.modal-body { padding: 22px; }
.detail-title { font-size: 23px; line-height: 1.35; letter-spacing: -.5px; margin: 14px 0 18px; overflow-wrap: anywhere; }
.detail-description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; color: var(--text); padding-bottom: 22px; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 20px; }
.detail-meta small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.detail-meta span { font-size: 13px; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.history { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 22px; }
.history h3 { margin-bottom: 18px; }
.event { padding: 0 0 20px 18px; border-left: 1px solid var(--line); position: relative; margin-left: 4px; }
.event::before { content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); left: -4px; top: 6px; }
.event strong { font-size: 13px; font-weight: 550; }
.event small { font-size: 11px; color: var(--muted); display: block; margin-top: 4px; }
.event p { font-size: 13px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; }
.comment-box textarea { min-height: 90px; } .comment-box .btn { margin-top: 12px; }
.resolution { padding: 16px; background: var(--green-soft); border: 1px solid var(--line); border-radius: 13px; font-size: 14px; margin-bottom: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.resolution strong { display: block; color: var(--green); margin-bottom: 6px; }
#toast { position: fixed; bottom: calc(24px + var(--safe-bottom)); left: 50%; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; z-index: 20; width: max-content; max-width: calc(100% - 32px - var(--safe-left) - var(--safe-right)); background: var(--text); color: var(--panel); padding: 13px 18px; border-radius: 13px; font-size: 13px; box-shadow: 0 8px 40px #0005; transition: .2s; overflow-wrap: anywhere; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
.report-filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; padding: 20px; margin-bottom: 24px; align-items: end; }
.report-filters .field { margin: 0; grid-column: span 3; }
.report-filters .btn { grid-column: span 2; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.report-metric { padding: 22px; }
.report-metric strong { font-size: 36px; letter-spacing: -1px; display: block; margin-top: 12px; overflow-wrap: anywhere; }
.report-metric p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.report-note { font-size: 12px; color: var(--muted); margin: 16px 0 24px; }
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.profile-head > div { min-width: 0; }
.profile-head .avatar { width: 52px; height: 52px; font-size: 18px; }
.profile-head h2 { font-size: 18px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-heading { margin-top: 30px; }
.executor-panel { margin-bottom: 18px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.executor-intro { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.executor-intro > .icon { color: var(--accent); margin-top: 2px; }
.executor-intro h3 { margin-bottom: 6px; }
.executor-form .field { margin-bottom: 12px; }
.executor-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.executor-controls .btn { min-height: 46px; }
.team-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.user-row { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) 165px; align-items: center; gap: 12px; }
.user-row:last-child { border-bottom: 0; padding-bottom: 0; }
.user-row strong { font-size: 14px; overflow-wrap: anywhere; }
.user-row small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.user-row select { min-height: 44px; font-size: 14px; padding: 8px 10px; }
.user-row .role-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.admin-project { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }
.admin-project summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 14px 0; min-height: 48px; }
.admin-project form { padding-top: 8px; }
.load-more { margin: 16px auto; display: flex; }
.status-pill { padding: 5px 9px; border-radius: 7px; font-size: 11px; background: var(--blue-soft); color: var(--blue); }
.status-pill.done { background: var(--green-soft); color: var(--green); } .status-pill.waiting { background: var(--orange-soft); color: var(--orange); } .status-pill.cancelled { background: var(--red-soft); color: var(--red); }
/* A compact, neutral workspace inspired by the iOS reference. */
body { background: var(--bg); }
h1 { letter-spacing: -.9px; font-weight: 720; }
h2, h3 { font-weight: 650; }
.brand { letter-spacing: -.6px; }
.brand-icon { background: transparent; color: var(--accent); box-shadow: none; }
.brand-icon .icon { width: 29px; height: 29px; stroke-width: 1.7; }
.topbar { border-bottom: 0; }
.avatar { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.nav { gap: 20px; min-height: 58px; padding: 0; }
.nav button { padding: 12px 8px; font-weight: 600; }
.nav button.active { color: var(--text); }
.nav button.active::after { background: var(--text); height: 3px; }
.eyebrow { color: var(--muted); letter-spacing: .8px; }
.page-heading .eyebrow { display: none; }
.btn { border-radius: 12px; background: var(--panel); border-color: var(--line); }
.btn.primary { background: linear-gradient(100deg, #e61e4d, #d70466); color: #fff; box-shadow: none; }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn:active:not(:disabled), .task-card:active { transform: scale(.99); }
.icon-button { border-radius: 50%; }
.app-refresh { flex: 0 0 auto; color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.header-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.header-actions .app-refresh { border-radius: 14px; }
.auth-page { width: 100%; min-height: var(--app-visible-height,100dvh); display: grid; grid-template-columns: minmax(0,1fr); place-items: center; padding: calc(24px + var(--safe-top)) calc(16px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(16px + var(--safe-left)); }
.auth-card { width: 100%; min-width: 0; max-width: 460px; padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.auth-card h1 { margin-top: 28px; font-size: 30px; }
.auth-card > p { margin-top: 12px; line-height: 1.6; }
.auth-card form { margin-top: 24px; }
.registration-identity { display: grid; gap: 5px; margin: 24px 0; padding: 16px; border-radius: 14px; background: var(--panel2); overflow-wrap: anywhere; }
.registration-notice { padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.registration-notice p, .registration-message { margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; }
.registration-check { margin-top: 18px; }
.auth-card .registration-footnote { font-size: 12px; }
.registration-panel { margin-bottom: 20px; }
.registration-panel .section-head { align-items: flex-start; }
.registration-panel .section-head > div { min-width: 0; }
.registration-panel h3 { margin-bottom: 8px; }
.registration-item { padding: 20px 0; border-top: 1px solid var(--line); }
.registration-item-head, .registration-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.registration-item-head > div { min-width: 0; }
.registration-item-head strong { overflow-wrap: anywhere; }
.registration-actions { justify-content: flex-start; margin-top: 16px; }
.registration-empty { padding: 12px 0; font-size: 14px; }
.registration-reason { padding: 12px; background: var(--panel2); border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.request-badge { position: absolute; top: 8px; right: -14px; display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; }
.auth-help { font-size: 12px; color: var(--muted); }
.web-account-panel { margin-bottom: 20px; }
.web-account-panel form { margin-top: 20px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.reset-web-access { margin-top: 6px; padding: 4px 0; color: var(--accent); }
.workspace-search { margin: 0 0 24px; grid-row: auto; }
.workspace-search input { min-height: 58px; padding: 16px 20px 16px 52px; border-radius: 32px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 3px 12px #00000012; font-size: 15px; font-weight: 550; }
.workspace-search .icon { left: 22px; top: 20px; width: 19px; height: 19px; color: var(--text); }
.workspace-search input::placeholder { color: var(--text); opacity: 1; }
.project-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.project-card, .project-card.active { border: 0; background: transparent; box-shadow: none; border-radius: 0; padding: 6px 8px 16px; text-align: center; }
.project-card::after { content: ''; position: absolute; bottom: 0; height: 3px; left: 20%; right: 20%; border-radius: 3px 3px 0 0; background: transparent; }
.project-card.active::after { background: var(--text); }
.project-symbol { display: grid; place-items: center; width: 48px; height: 45px; margin: 0 auto 8px; color: var(--muted); }
.project-symbol .icon { width: 32px; height: 32px; stroke-width: 1.5; filter: drop-shadow(0 3px 2px #00000012); }
.project-card.active .project-symbol { color: var(--accent); }
.project-mark { justify-content: center; padding: 0; min-height: 20px; font-size: 13px; color: var(--muted); }
.project-card.active .project-mark { color: var(--text); }
.project-count { justify-content: center; font-size: 12px; font-weight: 500; letter-spacing: 0; margin-top: 5px; color: var(--muted); gap: 4px; }
.project-count span { font-size: 11px; }
.project-card .check { display: none; }
.overview { background: var(--panel2); border-radius: 18px; padding: 14px 6px; gap: 0; }
.stat { border: 0; border-radius: 0; background: transparent; justify-content: center; gap: 10px; padding: 2px 12px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-icon, .stat-icon.orange, .stat-icon.green { background: transparent; color: var(--muted); width: 24px; height: 24px; border-radius: 0; }
.stat strong { font-size: 22px; }.stat small { font-size: 11px; }
.task-toolbar { grid-template-columns: minmax(0,1fr) auto; margin-bottom: 20px; }
.tabs { grid-column: 1; border: 0; background: transparent; padding: 0; gap: 8px; }
.tabs button { border: 1px solid var(--line); border-radius: 24px; padding: 9px 10px; background: var(--panel); color: var(--text); font-weight: 500; }
.tabs button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.switch-row { grid-row: 1; }
.task-list { gap: 16px; }
.task-card { padding: 22px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 3px 14px #00000005; transition: border-color .15s, box-shadow .15s; }
.task-code { font-family: inherit; color: var(--muted); letter-spacing: .2px; font-weight: 600; }
.task-title { font-size: 17px; line-height: 1.45; font-weight: 650; letter-spacing: -.2px; }
.task-description { margin-top: 8px; }
.priority { padding: 4px 8px; border-radius: 8px; background: var(--panel2); }
.priority.high { background: var(--orange-soft); }.priority.critical { background: var(--red-soft); }
.task-people { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.task-people span { min-width: 0; overflow-wrap: anywhere; }
.task-footer { border-top: 0; margin-top: 8px; padding-top: 4px; }
.task-footer span { font-size: 12px; }
.panel { box-shadow: none; border-radius: 22px; }
.tip { background: var(--panel2); border-color: transparent; }
.tip > .icon { color: var(--text); }
.person-link { display: inline-block; overflow-wrap: anywhere; }
.person-link small { color: var(--accent); font-size: inherit; margin: 2px 0 0; }
.detail-meta a:hover { text-decoration: underline; }
.detail-meta { background: var(--panel2); border: 0; border-radius: 18px; }
.detail-title { font-size: 26px; letter-spacing: -.5px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.status-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.executor-panel { border-color: var(--line); }
.executor-intro > .icon { color: var(--text); width: 24px; height: 24px; }
.delete-summary { display: flex; gap: 14px; padding: 18px; margin-bottom: 16px; background: var(--red-soft); border-radius: 16px; }
.delete-summary > .icon { color: var(--red); margin-top: 2px; }
.delete-summary > div { min-width: 0; }
.delete-summary p { margin-top: 4px; font-size: 14px; }
#delete-form > .field-hint { margin-bottom: 20px; }
@media (hover: hover) {
  .btn:hover { background: var(--accent-soft); } .btn.primary:hover { background: color-mix(in srgb, var(--accent) 85%, black); }
  .task-card:hover { border-color: var(--accent); } .icon-button:hover { background: var(--panel2); color: var(--text); }
}
@media (max-width: 1020px) {
  .workspace-label { display: none; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-stack .tip { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-shell { padding-inline: calc(16px + var(--safe-left)) calc(16px + var(--safe-right)); }
  .topbar { min-height: 64px; padding-block: 10px; gap: 10px; }
  .topbar-right { gap: 2px; } .topbar-right .user-name { display: none; }
  .brand { font-size: 17px; gap: 9px; } .brand-icon { width: 34px; height: 34px; border-radius: 11px; }
  .topbar .avatar { width: 36px; height: 36px; }
  .topbar-right > .avatar { display: none; }
  .header-actions { padding-block: 4px 6px; }
  .header-actions .app-refresh { padding: 10px 14px; }
  .auth-card { padding: 24px 20px; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 0; height: calc(68px + var(--safe-bottom)); padding: 6px calc(12px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(12px + var(--safe-left)); margin: 0; z-index: 5; background: var(--nav-bg); backdrop-filter: blur(16px); border-top: 1px solid var(--line); border-bottom: 0; gap: 6px; }
  .nav button { min-width: 0; flex-direction: column; gap: 4px; justify-content: center; text-align: center; font-size: 11px; padding: 6px 2px; line-height: 1.25; border-radius: 12px; }
  .nav .icon { width: 21px; height: 21px; }
  .nav .request-badge { top: 0; right: calc(50% - 29px); }
  .nav button.active { background: transparent; color: var(--accent); }
  .nav button.active::after { display: none; }
  .main { padding-top: 20px; padding-bottom: calc(94px + var(--safe-bottom)); }
  .page-heading { gap: 12px; align-items: flex-start; margin-bottom: 22px; }
  .page-heading p { font-size: 12px; }
  .page-heading .btn { flex: 0 0 auto; width: 46px; height: 46px; padding: 0; border-radius: 14px; margin-top: 18px; }
  .page-heading .btn .desktop-label { display: none; }
  h1 { font-size: 28px; } h2 { font-size: 18px; }
  .project-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 16px; }
  .project-card { padding: 0 2px 12px; border-radius: 0; }
  .project-mark { font-size: 11px; padding-right: 0; gap: 0; min-height: 30px; align-items: flex-start; }
  .project-card .check { right: 11px; top: 15px; }
  .project-card .check .icon { width: 14px; height: 14px; }
  .project-count { font-size: 11px; margin-top: 0; }
  .project-count span { font-size: 10px; }
  .overview { gap: 0; margin-bottom: 24px; padding: 12px 4px; }
  .stat { display: flex; gap: 6px; padding: 0 6px; border-radius: 0; }
  .stat-icon { width: 20px; height: 20px; border-radius: 0; }
  .stat-icon .icon { width: 17px; height: 17px; }
  .stat strong { font-size: 20px; } .stat small { font-size: 10px; }
  .content-grid { gap: 24px; }
  .task-card { padding: 18px; border-radius: 20px; }
  .task-title { font-size: 16px; }
  .task-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  .panel { padding: 18px; border-radius: 16px; }
  .side-stack { gap: 12px; }.tabs { gap: 5px; }.tabs button { font-size: 11px; padding-inline: 6px; }.task-toolbar { gap: 8px; }
  .side-stack .panel { padding: 16px; }
  .side-stack .panel h3 { font-size: 14px; }
  .contact .avatar { display: none; }
  .side-stack .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .profile-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .report-metric { padding: 16px; }
  .report-metric strong { font-size: 31px; }
  .report-filters { gap: 12px; padding: 16px; }
  .report-filters .btn { font-size: 12px; padding: 10px 6px; }
  .report-filters .icon { width: 16px; height: 16px; }
  dialog { padding: calc(8px + var(--safe-top)) calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left)); }
  .modal-surface { border-radius: 20px; }
  .modal-head { padding: 12px 16px; }
  .modal-body { padding: 18px 16px; }
  .detail-title { font-size: 21px; }
  .detail-actions .btn { flex: 1 1 130px; }
  .form-actions .btn { flex: 1 1 100px; }
  #toast { bottom: calc(82px + var(--safe-bottom)); }
  .keyboard-open .nav { visibility: hidden; }
  .keyboard-open #toast { bottom: calc(16px + var(--app-keyboard-offset, 0px)); }
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .executor-controls { grid-template-columns: minmax(0, 1fr); }
  .executor-controls .btn { width: 100%; }
  .user-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .user-row select { font-size: 16px; }
  .detail-meta { padding: 14px; gap: 16px 12px; }
  .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filters .field { grid-column: span 2; }
  .report-filters .btn { grid-column: span 1; }
  .report-filters button[type=submit] { grid-column: 1 / -1; }
  .section-head .badge { font-size: 10px; max-width: 42%; }
}
@media (max-width: 350px) {
  .app-shell { padding-inline: calc(12px + var(--safe-left)) calc(12px + var(--safe-right)); }
  .brand { font-size: 15px; }
  .topbar-right .icon-button { width: 34px; }
  h1 { font-size: 26px; }
  .project-card { padding: 0 1px 12px; }
  .project-count span { font-size: 9px; }
  .stat { padding: 0 4px; }.stat-icon { display: none; }
  .side-stack { grid-template-columns: minmax(0, 1fr); }
  .tabs button { font-size: 10px; padding-inline: 5px; }
  .detail-meta { grid-template-columns: minmax(0, 1fr); }
}
/* One motion system: no overshoot and no competing parent/child entrances. */
:root { --motion-ease: cubic-bezier(.16,1,.3,1); }
html { scrollbar-gutter: stable; }
.main { overflow-anchor: none; }
button, summary { -webkit-tap-highlight-color: transparent; }
.btn, .icon-button, .avatar, .task-card, .project-card, .nav button, .tabs button, .stat {
  transition: scale .38s var(--motion-ease), background-color .6s ease, color .6s ease, border-color .6s ease, box-shadow .3s ease;
}
.btn:active:not(:disabled), .icon-button:active, .avatar:active, .task-card:active,
.nav button:active, .tabs button:active, .stat:active { transform: none; scale: .95; transition-duration: .09s; }
.project-symbol, .nav .icon { transition: color .35s ease, transform .45s var(--motion-ease); }
.project-card.active .project-symbol { transform: none; }
.project-card:active { scale: 1; }
.nav button.active .icon { transform: scale(1.12); }
.project-card::after, .nav button::after { transition: background-color .4s ease, opacity .35s ease; }
.nav button:not(.active)::after { content: ''; position: absolute; inset: auto 0 -1px; height: 3px; opacity: 0; }
input, textarea, select { transition: border-color .3s, box-shadow .3s, background-color .6s, color .6s; }
.theme-switching body, .theme-switching .app-shell, .theme-switching .nav,
.theme-switching .panel, .theme-switching .task-card, .theme-switching .overview,
.theme-switching .stat, .theme-switching .btn, .theme-switching .avatar,
.theme-switching input, .theme-switching select, .theme-switching textarea,
.theme-switching .tabs button, .theme-switching .icon-button, .theme-switching .modal-surface,
.theme-switching .modal-head, .theme-switching .detail-meta, .theme-switching .status-pill,
.theme-switching .project-card, .theme-switching .muted, .theme-switching .tip {
  transition: background-color .6s ease, color .6s ease, border-color .6s ease, box-shadow .3s ease, scale .38s var(--motion-ease);
}
.modal-surface { max-height: min(780px, 100%); }
dialog::backdrop { animation: backdrop-in .4s ease both; }
.task-skeleton { display: grid; gap: 22px; padding-top: 10px; }
.task-skeleton i { display: block; height: 28px; border-radius: 12px; background: var(--panel2); animation: skeleton-breathe 1.4s ease-in-out infinite alternate; }
.task-skeleton i:nth-child(2) { height: 100px; }
.task-skeleton i:nth-child(3) { height: 140px; }
.task-skeleton i:last-child { width: 65%; }
.refreshing .icon { animation: refresh-turn .8s linear infinite; }
#toast { transition: opacity .3s ease, transform .48s var(--motion-ease); transform: translate(-50%, 22px); }
#toast.visible { transform: translate(-50%, 0); }
.assignee-field .btn { min-height: 36px; padding: 6px 0; margin-top: 4px; font-size: 12px; border: 0; color: var(--accent); }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes skeleton-breathe { from { opacity: .4; } to { opacity: .85; } }
.page-loading .topbar::after { content: ""; position: absolute; height: 3px; bottom: 0; left: 0; width: 100%; background: var(--accent); transform-origin: left; animation: loading-track 1.2s ease-in-out infinite; pointer-events: none; }
.topbar { position: relative; }
@keyframes loading-track { 0% { transform: scaleX(0); opacity: .3; } 70% { transform: scaleX(.85); opacity: .8; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes refresh-turn { to { transform: rotate(360deg); } }
@media (hover: hover) {
  .task-card:hover { border-color: var(--accent); box-shadow: 0 10px 28px #00000010; }
  .project-card:hover .project-symbol { color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, *::backdrop { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:active { scale: 1 !important; }
}
