:root {
  color-scheme: light;
  --desktop: #3a6ea5;
  --window: #c0c0c0;
  --window-light: #dfdfdf;
  --window-dark: #808080;
  --active: #0a246a;
  --active-end: #a6caf0;
  --urgent: #b00020;
  --doing: #000080;
  --waiting: #7a4a00;
  --done: #087830;
  --raised: inset 1px 1px #fff, inset -1px -1px #0a0a0a, inset 2px 2px #dfdfdf, inset -2px -2px #808080;
  --pressed: inset 1px 1px #0a0a0a, inset -1px -1px #fff, inset 2px 2px #808080, inset -2px -2px #dfdfdf;
  --sunken: inset 1px 1px #808080, inset -1px -1px #fff, inset 2px 2px #0a0a0a, inset -2px -2px #dfdfdf;
  font-family: Tahoma, "MS UI Gothic", "Yu Gothic UI", "Segoe UI", sans-serif;
  font-size: 12px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--desktop); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; overflow: hidden; background: var(--desktop); color: #000; }
button, input, select, textarea { font: inherit; }
button, select { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -3px;
}
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; flex: 0 0 auto; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--desktop);
}
.login-glow { display: none; }
.login-card {
  position: relative;
  width: min(390px, 100%);
  min-height: 250px;
  margin: 0;
  padding: 48px 26px 20px;
  border: 0;
  border-radius: 0;
  background: var(--window);
  box-shadow: var(--raised), 7px 7px 0 rgba(0,0,0,.18);
}
.login-titlebar {
  position: absolute;
  inset: 4px 4px auto;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  background: linear-gradient(90deg, var(--active), var(--active-end));
  color: #fff;
  font-weight: 700;
}
.brand-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: var(--active);
  font-weight: 700;
  box-shadow: none;
}
.brand-mark-large { float: left; width: 34px; height: 34px; margin: 1px 12px 16px 0; }
.eyebrow { display: none; }
.login-card h1 { margin: 0 0 3px; padding-top: 1px; font-size: 15px; line-height: 1.35; letter-spacing: 0; }
.login-copy { margin: 0 0 24px; color: #000; font-size: 12px; line-height: 1.4; }
.field-label { display: block; clear: both; margin: 0 0 4px; font-size: 12px; }
.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 2px 5px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: var(--sunken);
}
.login-input-wrap .icon { display: none; }
.login-input-wrap input { width: 100%; height: 20px; border: 0; outline: 0; background: transparent; color: #000; }
.form-error { min-height: 16px; margin: 4px 0; color: var(--urgent); font-size: 11px; }
.primary-button, .sidebar-add, .small-button, .icon-button, .view-tab,
.filters select, .delete-button, .add-check-item {
  border: 0;
  border-radius: 0;
  background: var(--window);
  color: #000;
  box-shadow: var(--raised);
}
.primary-button {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 14px;
  font-weight: 400;
}
.primary-button:active, .sidebar-add:active, .small-button:active, .icon-button:active,
.view-tab:active, .delete-button:active, .add-check-item:active { box-shadow: var(--pressed); }
.login-button { display: flex; width: 100px; margin: 0 auto; }
.login-footnote { display: none; }

/* Main window */
.app-shell {
  height: calc(100vh - 20px);
  min-height: 440px;
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  grid-template-rows: 26px 25px minmax(0, 1fr) 22px;
  margin: 10px;
  padding: 3px;
  overflow: hidden;
  background: var(--window);
  box-shadow: var(--raised), 5px 5px 0 rgba(0,0,0,.22);
}
.classic-titlebar {
  grid-column: 1 / -1;
  grid-row: 1;
  height: 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 0 4px;
  background: linear-gradient(90deg, var(--active), var(--active-end));
  color: #fff;
  font-size: 12px;
}
.classic-titlebar > div { display: flex; align-items: center; gap: 5px; }
.titlebar-icon { width: 16px; height: 16px; display: grid; place-items: center; background: #fff; color: var(--active); border: 1px solid #000; font-size: 10px; font-weight: 700; }
.window-controls { height: 19px; display: flex !important; gap: 2px !important; }
.window-controls span { width: 20px; height: 19px; display: grid; place-items: center; background: var(--window); color: #000; box-shadow: var(--raised); font-family: Arial,sans-serif; font-size: 12px; font-weight: 700; }
.classic-menubar {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 1px 3px;
  border-bottom: 1px solid var(--window-dark);
  background: var(--window);
}
.classic-menubar button { height: 20px; border: 0; padding: 1px 8px; background: transparent; color: #000; }
.classic-menubar button:hover { background: var(--active); color: #fff; }

/* Sidebar */
.sidebar {
  position: static;
  z-index: 1;
  grid-column: 1;
  grid-row: 3;
  width: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 5px;
  border: 0;
  border-right: 1px solid var(--window-dark);
  background: var(--window);
  overflow: hidden;
}
.sidebar-brand { display: none; }
.sidebar-add {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 8px;
  margin-bottom: 5px;
  font-size: 12px;
}
.sidebar-nav { display: grid; gap: 0; padding: 2px; margin: 0; background: #fff; box-shadow: var(--sunken); }
.nav-item {
  min-height: 25px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #000;
  text-align: left;
  font-size: 12px;
}
.nav-item:hover { background: #e8e8e8; }
.nav-item.is-active { background: var(--active); color: #fff; font-weight: 400; }
.nav-item.is-active .icon { color: #fff; }
.nav-item b { min-width: 18px; padding: 0; background: transparent; color: inherit; text-align: right; font-size: 11px; }
.sidebar-section { min-height: 0; display: flex; flex-direction: column; margin-top: 7px; overflow: hidden; }
.sidebar-section-title { height: 20px; padding: 3px 4px; border: 1px solid var(--window-dark); border-bottom: 0; background: var(--window-light); color: #000; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.project-nav { max-height: none; min-height: 0; flex: 1; display: block; overflow: auto; padding: 2px; background: #fff; box-shadow: var(--sunken); scrollbar-color: var(--window-dark) var(--window); }
.project-link { width: 100%; min-height: 23px; display: flex; align-items: center; gap: 6px; padding: 2px 5px; border: 0; border-radius: 0; background: #fff; color: #000; text-align: left; font-size: 11px; }
.project-link:hover { background: var(--active); color: #fff; }
.project-dot { width: 8px; height: 8px; border: 1px solid #555; border-radius: 0; flex: 0 0 auto; }
.project-link span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-link b { margin-left: auto; font-size: 10px; font-weight: 400; }
.sidebar-footer { display: grid; gap: 3px; margin-top: 5px; padding-top: 0; border: 0; }
.sidebar-utility { min-height: 24px; display: flex; align-items: center; gap: 5px; padding: 2px 5px; border: 0; background: transparent; color: #000; font-size: 11px; text-align: left; }
.sidebar-utility:hover { background: #e0e0e0; }
.profile-button { width: 100%; min-height: 34px; display: grid; grid-template-columns: 25px 1fr 14px; align-items: center; gap: 5px; padding: 3px; border: 0; border-top: 1px solid var(--window-dark); border-radius: 0; background: transparent; color: #000; text-align: left; }
.avatar { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--window-dark); border-radius: 0; background: #fff; color: #000; font-size: 10px; }
.profile-button strong { display: block; font-size: 11px; }
.profile-button small { display: none; }
.profile-button .icon { width: 12px; color: #000; }

/* Workspace */
.main-content {
  grid-column: 2;
  grid-row: 3;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
  overflow: hidden;
  background: var(--window);
}
.topbar {
  position: static;
  z-index: 1;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px;
  border-bottom: 1px solid var(--window-dark);
  background: var(--window);
  backdrop-filter: none;
}
.mobile-brand { display: none; }
.search-box {
  width: min(430px, 48vw);
  height: 27px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #000;
  box-shadow: var(--sunken);
}
.search-box .icon { width: 14px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #000; font-size: 12px; }
.search-box kbd { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 5px; }
.history-controls { display: inline-flex; align-items: center; gap: 2px; }
.icon-button { width: 28px; height: 27px; display: grid; place-items: center; padding: 0; }
.icon-button:disabled { color: var(--window-dark); box-shadow: var(--raised); cursor: default; }
.icon-button:disabled .icon { opacity: .55; }
.top-add { height: 27px; min-height: 27px; padding: 3px 10px; font-size: 11px; }
.content-wrap { min-height: 0; max-width: none; margin: 0; padding: 6px; overflow: auto; }
.page-heading { min-height: 25px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 3px 5px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading h1 { margin: 0; font-size: 13px; line-height: 1.2; letter-spacing: 0; }
.heading-actions { display: flex; align-items: center; gap: 6px; }
.week-jump-button { min-height: 23px; padding: 2px 8px; white-space: nowrap; }
.page-heading .eyebrow, .page-subtitle { display: none; }
.sync-state { display: flex; align-items: center; gap: 4px; padding: 0; color: #333; font-size: 10px; white-space: nowrap; }
.sync-dot { width: 7px; height: 7px; border: 1px solid #333; border-radius: 0; background: #00a000; box-shadow: none; }
.sync-state.is-syncing .sync-dot { background: #ffff00; animation: blink 1s steps(2,end) infinite; }

/* Compact status */
.summary-section { display: grid; grid-template-columns: minmax(210px, 1.6fr) repeat(3, minmax(90px, .6fr)); gap: 4px; margin: 0 0 7px; }
.progress-card, .metric-card { min-height: 48px; border: 0; border-radius: 0; background: var(--window); box-shadow: var(--sunken); }
.progress-card { display: flex; align-items: center; gap: 9px; padding: 5px 8px; }
.progress-ring {
  --progress: 0deg;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--window-dark);
  border-radius: 50%;
  background: conic-gradient(var(--active) var(--progress), #e5e5e5 0);
  position: relative;
}
.progress-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--window); }
.progress-ring span { position: relative; z-index: 1; font-size: 10px; font-weight: 700; }
.progress-card .stat-label { display: block; color: #333; font-size: 10px; }
.progress-card strong { display: block; margin-top: 2px; font-size: 12px; }
.progress-card small { display: block; color: #555; font-size: 9px; }
.metric-card { display: flex; align-items: center; gap: 7px; padding: 6px 8px; }
.metric-icon { width: 7px; height: 7px; border: 1px solid #333; border-radius: 0; font-size: 0; }
.metric-coral .metric-icon { background: #c00000; box-shadow: none; }
.metric-violet .metric-icon { background: #000080; box-shadow: none; }
.metric-amber .metric-icon { background: #c08000; box-shadow: none; }
.metric-card strong { display: block; font-size: 16px; line-height: 1; }
.metric-card span:last-child { display: block; margin-top: 2px; color: #333; font-size: 10px; }
.focus-section { display: none !important; }
.task-section { margin: 0; }
.task-toolbar { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 3px 0; }
.view-switcher { display: inline-flex; padding: 0; border: 0; border-radius: 0; background: transparent; }
.view-tab { height: 26px; display: flex; align-items: center; gap: 4px; padding: 3px 9px; font-size: 11px; }
.view-tab .icon { width: 13px; height: 13px; }
.view-tab.is-active { background: var(--window); color: #000; box-shadow: var(--pressed); }
.filters { display: flex; gap: 5px; }
.filters select { height: 26px; min-width: 130px; padding: 2px 22px 2px 6px; color: #000; font-size: 11px; }

/* Details table */
.task-list { overflow: hidden; border: 0; border-radius: 0; background: #fff; box-shadow: var(--sunken); }
.task-list-header, .task-row {
  display: grid;
  grid-template-columns: 29px minmax(220px, 1.8fr) minmax(105px,.6fr) 86px 82px 100px 22px;
  align-items: center;
  gap: 4px;
  padding: 0 5px;
}
.task-list-header { min-height: 23px; border-bottom: 1px solid var(--window-dark); background: var(--window); color: #000; font-size: 10px; font-weight: 400; }
.task-list-header > span { height: 20px; display: flex; align-items: center; padding-left: 3px; border-right: 1px solid var(--window-dark); }
.task-row { min-height: 32px; border-bottom: 1px solid #dfdfdf; background: #fff; color: #000; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #e8eef8; }
.task-row:focus-within { background: #dce7f7; }
.complete-button { width: 16px; height: 16px; display: grid; place-items: center; border: 0; border-radius: 0; background: #fff; color: transparent; box-shadow: var(--sunken); }
.complete-button.is-done { background: #fff; color: #006000; }
.complete-button .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.task-name { min-width: 0; }
.task-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 400; }
.task-name span { display: none; }
.row-project { display: flex; align-items: center; gap: 5px; min-width: 0; color: #222; font-size: 10px; }
.row-project span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { width: fit-content; padding: 0; border-radius: 0; background: transparent !important; font-size: 10px; font-weight: 400; white-space: nowrap; }
.status-todo { color: #333; }
.status-doing { color: var(--doing); }
.status-waiting { color: var(--waiting); }
.status-done { color: var(--done); }
.due-date { color: #222; font-size: 10px; white-space: nowrap; }
.due-date.is-overdue { color: var(--urgent); font-weight: 700; }
.due-date.is-today { color: var(--urgent); }
.row-progress { display: flex; align-items: center; gap: 4px; }
.progress-track { height: 9px; overflow: hidden; border: 1px solid var(--window-dark); border-radius: 0; background: #fff; }
.progress-track span { display: block; height: 100%; border-radius: 0; background: var(--active); }
.row-progress .progress-track { flex: 1; }
.row-progress b { width: 27px; color: #222; font-size: 9px; font-weight: 400; text-align: right; }
.more-button { width: 18px; height: 19px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #000; }
.more-button:hover { background: var(--active); color: #fff; }
.more-button .icon { width: 11px; }
.empty-state { display: grid; place-items: center; min-height: 180px; border: 0; border-radius: 0; background: #fff; color: #333; text-align: center; padding: 20px; box-shadow: var(--sunken); }
.empty-state .icon { width: 22px; height: 22px; margin-bottom: 7px; }
.empty-state strong { display: block; font-size: 12px; font-weight: 400; }
.empty-state p { margin: 4px 0 0; font-size: 10px; }

/* Board */
.task-board { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 5px; overflow-x: auto; padding: 1px 1px 5px; }
.board-column { min-height: 330px; padding: 4px; border: 0; border-radius: 0; background: var(--window); box-shadow: var(--sunken); }
.board-column.is-dragover { background: #d7e4f6; }
.board-heading { height: 24px; display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; background: var(--active); color: #fff !important; font-size: 11px; font-weight: 700; }
.board-heading span { display: inline-flex; align-items: center; gap: 5px; }
.board-heading i { display: none; }
.board-heading b { color: #fff; font-size: 10px; font-weight: 400; }
.board-cards { display: grid; gap: 3px; padding-top: 4px; }
.board-card { padding: 6px; border: 1px solid var(--window-dark); border-radius: 0; background: #fff; color: #000; cursor: move; }
.board-card:hover { outline: 1px dotted #000; outline-offset: -3px; }
.board-card h3 { margin: 6px 0 8px; font-size: 11px; line-height: 1.35; font-weight: 400; }
.board-card .project-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; }
.priority-pill { border: 0; border-radius: 0; padding: 1px 3px; background: #eee; font-size: 9px; font-weight: 400; }
.priority-urgent { color: var(--urgent); }
.priority-high { color: var(--doing); }
.priority-normal { color: #333; }
.priority-low { color: var(--done); }
.focus-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.board-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #333; font-size: 9px; }
.board-card-footer .progress-track { width: 60px; height: 7px; }

/* Inbox */
.inbox-composer { display: flex; gap: 5px; margin: 0 0 5px; padding: 4px; background: var(--window); box-shadow: var(--sunken); }
.inbox-composer textarea { flex: 1; min-height: 54px; resize: vertical; padding: 5px; border: 0; border-radius: 0; background: #fff; color: #000; box-shadow: var(--sunken); }
.inbox-list { display: grid; gap: 3px; }
.inbox-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px; border: 1px solid var(--window-dark); border-radius: 0; background: #fff; color: #000; }
.inbox-item.is-closed { color: #777; background: #eee; }
.inbox-item p { margin: 0; font-size: 11px; line-height: 1.45; white-space: pre-wrap; }
.inbox-item time { display: block; margin-top: 4px; color: #555; font-size: 9px; }
.inbox-actions { display: flex; align-items: center; gap: 3px; }
.small-button { min-height: 24px; padding: 2px 8px; font-size: 10px; }
.small-button.is-danger { color: var(--urgent); }

/* Properties window */
.drawer-backdrop { position: fixed; z-index: 50; inset: 0; background: rgba(0,0,0,.35); }
.drawer {
  position: fixed;
  z-index: 55;
  top: 18px;
  right: 18px;
  width: min(540px, calc(100% - 36px));
  height: calc(100dvh - 36px);
  overflow: auto;
  padding: 3px;
  border: 0;
  background: var(--window);
  box-shadow: var(--raised), 7px 7px 0 rgba(0,0,0,.2);
  transform: translateX(calc(100% + 30px));
  transition: transform .12s linear;
}
.drawer.is-open { transform: translateX(0); }
.drawer-header { position: sticky; z-index: 2; top: 0; min-height: 23px; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 0 5px; border: 0; background: linear-gradient(90deg, var(--active), var(--active-end)); color: #fff; }
.drawer-header span { color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.drawer-close { width: 19px; height: 19px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0; background: var(--window); color: #000; box-shadow: var(--raised); }
.drawer-close .icon { width: 12px; }
.drawer-body { padding: 12px 10px 68px; }
.field { display: grid; gap: 3px; margin-bottom: 10px; }
.field > label, .checklist-heading label { color: #000; font-size: 11px; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; padding: 4px 6px; border: 0; border-radius: 0; outline: 0; background: #fff; color: #000; box-shadow: var(--sunken); }
.field input, .field select { height: 27px; }
.field textarea { min-height: 70px; resize: vertical; line-height: 1.45; }
.title-field input { height: 31px; padding: 4px 6px; font-size: 14px; font-weight: 700; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.status-action { min-width: 0; height: 27px; padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--window); color: #222; font-size: 10px; }
.status-action.is-active { background: var(--active); color: #fff; box-shadow: var(--pressed); }
.status-action:disabled { color: #777; }
.checklist-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.checklist-heading strong { font-size: 10px; }
.checklist-items { display: grid; gap: 2px; }
.checklist-item { min-height: 29px; display: grid; grid-template-columns: 19px 1fr 23px; align-items: center; gap: 3px; padding: 2px 3px; border: 0; border-radius: 0; background: #fff; box-shadow: var(--sunken); }
.checklist-item input[type="checkbox"] { appearance: none; width: 14px; height: 14px; margin: 0; border: 0; border-radius: 0; background: #fff; box-shadow: var(--sunken); }
.checklist-item input[type="checkbox"]:checked { background: linear-gradient(135deg, transparent 42%, #006000 43% 55%, transparent 56%), linear-gradient(45deg, transparent 45%, #006000 46% 58%, transparent 59%), #fff; }
.checklist-item input[type="text"] { height: 22px; padding: 2px 3px; box-shadow: none; }
.checklist-item button { width: 21px; height: 21px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #333; }
.checklist-item button:hover { background: var(--active); color: #fff; }
.checklist-item button .icon { width: 12px; }
.add-check-item { width: 100%; min-height: 25px; display: flex; align-items: center; gap: 4px; margin-top: 3px; padding: 3px 7px; font-size: 10px; }
.drawer-footer { position: fixed; z-index: 3; right: 21px; bottom: 21px; width: min(534px, calc(100% - 42px)); display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 6px 8px; border-top: 1px solid var(--window-dark); background: var(--window); }
.delete-button { width: 29px; height: 27px; display: grid; place-items: center; padding: 0; }
.drawer-save { min-width: 105px; }
.memo-drawer-copy { margin: 0 0 8px; font-size: 11px; line-height: 1.4; }
.memo-drawer textarea { min-height: 180px; }

.memo-fab { position: fixed; z-index: 30; right: 22px; bottom: 38px; height: 28px; display: flex; align-items: center; gap: 5px; padding: 3px 10px; border: 0; border-radius: 0; background: var(--window); color: #000; box-shadow: var(--raised); font-size: 11px; }
.memo-fab:active { box-shadow: var(--pressed); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 35px; max-width: calc(100vw - 40px); padding: 7px 12px; border: 2px solid #000; border-radius: 0; background: #ffffe1; color: #000; box-shadow: 4px 4px 0 rgba(0,0,0,.2); font-size: 11px; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; transition: .12s; }
.toast.is-showing { opacity: 1; transform: translate(-50%, 0); }
.classic-statusbar { grid-column: 1 / -1; grid-row: 4; height: 19px; display: grid; grid-template-columns: 1fr 160px; gap: 3px; padding-top: 2px; background: var(--window); font-size: 10px; }
.classic-statusbar span { display: flex; align-items: center; padding: 1px 4px; box-shadow: var(--sunken); }
.mobile-nav { display: none; }

@keyframes blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 180px minmax(0,1fr); }
  .task-list-header, .task-row { grid-template-columns: 28px minmax(190px,1.6fr) 90px 78px 72px 22px; }
  .task-list-header > :nth-child(3), .task-row > :nth-child(3) { display: none; }
}

@media (max-width: 760px) {
  html { min-width: 0; height: 100%; overflow: hidden; background: var(--window); }
  body { position: fixed; inset: 0; width: 100%; min-height: 0; height: 100%; overflow: hidden; background: var(--window); overscroll-behavior: none; }
  .app-shell {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: 100vw;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 25px minmax(0,1fr);
    margin: 0;
    padding: calc(env(safe-area-inset-top) + 2px) 2px calc(env(safe-area-inset-bottom) + 2px);
    box-shadow: none;
  }
  .classic-titlebar { grid-column: 1; grid-row: 1; }
  .classic-titlebar > div:first-child { min-width: 0; }
  .classic-titlebar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .classic-menubar, .sidebar { display: none; }
  .main-content { grid-column: 1; grid-row: 2; grid-template-rows: 39px minmax(0,1fr); padding-bottom: 0; }
  .topbar { height: 39px; padding: 5px 3px; }
  .mobile-brand { display: none; }
  .search-box { flex: 1; width: auto; height: 27px; }
  .topbar-actions { flex: 0 0 auto; gap: 3px; }
  .topbar .icon-button { width: 26px; height: 27px; }
  .top-add { width: 28px; min-width: 28px; height: 27px; padding: 0; }
  .top-add span { display: none; }
  .content-wrap { padding: 4px 3px calc(66px + env(safe-area-inset-bottom)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .page-heading { min-height: 24px; padding: 1px 2px 3px; }
  .page-heading h1 { font-size: 12px; }
  .sync-state span:last-child { display: none; }
  .summary-section { grid-template-columns: 1.5fr repeat(3,1fr); gap: 2px; margin-bottom: 4px; }
  .progress-card, .metric-card { min-height: 42px; padding: 4px; }
  .progress-ring { width: 31px; height: 31px; }
  .progress-card { gap: 5px; }
  .progress-card .stat-label, .progress-card small { display: none; }
  .progress-card strong { margin: 0; font-size: 10px; white-space: nowrap; }
  .metric-card { display: block; }
  .metric-icon { display: none; }
  .metric-card strong { font-size: 14px; }
  .metric-card span:last-child { font-size: 9px; }
  .task-toolbar { min-height: 58px; align-items: stretch; flex-direction: column; gap: 3px; padding: 2px 0; }
  .view-switcher { width: 100%; }
  .view-tab { flex: 1; justify-content: center; }
  .filters { width: 100%; gap: 3px; }
  .filters select { min-width: 0; flex: 1; }
  .task-list-header { display: none; }
  .task-row {
    min-height: 43px;
    grid-template-columns: 24px minmax(0,1fr) 68px 17px;
    grid-template-rows: auto auto;
    gap: 1px 4px;
    padding: 3px 4px;
  }
  .task-row > :nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
  .task-row > :nth-child(2) { grid-column: 2; grid-row: 1; }
  .task-row > :nth-child(3) { display: none; }
  .task-row > :nth-child(4) { grid-column: 2; grid-row: 2; }
  .task-row > :nth-child(5) { grid-column: 3; grid-row: 1 / 3; justify-self: end; }
  .task-row > :nth-child(6) { display: none; }
  .task-row > :nth-child(7) { grid-column: 4; grid-row: 1 / 3; }
  .complete-button { position: relative; width: 34px; height: 34px; margin-left: -5px; background: transparent; box-shadow: none; }
  .complete-button::before { content: ""; position: absolute; top: 9px; left: 9px; width: 16px; height: 16px; background: #fff; box-shadow: var(--sunken); }
  .complete-button .icon { position: relative; z-index: 1; }
  .complete-button.is-done::before { background: #fff; }
  .task-name strong { white-space: normal; line-height: 1.2; }
  .task-board { grid-template-columns: repeat(4, 78vw); scroll-snap-type: x mandatory; }
  .board-column { scroll-snap-align: start; }
  .inbox-composer { flex-direction: column; }
  .inbox-item { grid-template-columns: 1fr; }
  .inbox-actions { justify-content: flex-end; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .status-action { height: 38px; font-size: 12px; }
  .drawer { inset: 0; width: 100%; height: 100dvh; padding: calc(env(safe-area-inset-top) + 2px) 2px calc(env(safe-area-inset-bottom) + 2px); transform: translateX(100%); }
  .drawer-body { padding: 9px 7px 67px; }
  .drawer-footer { right: 2px; bottom: calc(env(safe-area-inset-bottom) + 2px); width: calc(100% - 4px); padding: 5px 7px; }
  .mobile-nav { position: fixed; z-index: 40; left: 2px; right: 2px; bottom: env(safe-area-inset-bottom); height: 58px; display: grid; grid-template-columns: repeat(5,1fr); padding: 2px; background: var(--window); box-shadow: var(--raised); }
  .mobile-nav button { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; background: var(--window); color: #000; font-size: 9px; box-shadow: none; }
  .mobile-nav button.is-active { background: var(--active); color: #fff; }
  .mobile-nav .mobile-add { border-radius: 0; background: var(--window); color: #000; box-shadow: var(--raised); }
  .classic-statusbar { display: none; }
  .memo-fab { right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); width: 28px; padding: 0; justify-content: center; }
  .memo-fab span { display: none; }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .login-screen { min-height: 100dvh; padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); }
  button, input, select, textarea { touch-action: manipulation; }
  .search-box input, .filters select, .field input, .field select, .field textarea,
  .inbox-composer textarea, .memo-drawer textarea, #accessKey { font-size: 16px; }
}
