:root {
  color-scheme: light;
  --canvas: oklch(0.968 0.008 92);
  --surface: oklch(0.992 0.004 92);
  --surface-muted: oklch(0.945 0.008 92);
  --surface-strong: oklch(0.914 0.012 92);
  --ink: oklch(0.245 0.014 165);
  --ink-muted: oklch(0.49 0.018 165);
  --ink-faint: oklch(0.64 0.014 165);
  --line: oklch(0.86 0.012 92);
  --line-strong: oklch(0.77 0.018 92);
  --sidebar: oklch(0.245 0.016 165);
  --sidebar-muted: oklch(0.72 0.012 165);
  --accent: oklch(0.64 0.16 28);
  --accent-strong: oklch(0.56 0.17 28);
  --accent-soft: oklch(0.93 0.035 28);
  --success: oklch(0.56 0.12 153);
  --success-soft: oklch(0.93 0.035 153);
  --warning: oklch(0.66 0.13 78);
  --warning-soft: oklch(0.94 0.045 78);
  --danger: oklch(0.57 0.17 28);
  --danger-soft: oklch(0.94 0.038 28);
  --info: oklch(0.57 0.12 250);
  --info-soft: oklch(0.93 0.035 250);
  --purple: oklch(0.58 0.11 310);
  --purple-soft: oklch(0.94 0.03 310);
  --shadow-sm: 0 1px 2px oklch(0.25 0.012 165 / 0.05);
  --shadow-md: 0 14px 35px oklch(0.25 0.012 165 / 0.11);
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --sidebar-width: 226px;
  --transition: 180ms cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid oklch(0.72 0.12 250 / 0.55);
  outline-offset: 2px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background: var(--canvas);
}

.login-panel {
  width: min(410px, 100%);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.login-logo {
  display: block;
  height: 34px;
  margin-bottom: 28px;
}

.login-panel h1 {
  margin: 4px 0 8px;
  font-size: 1.6rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.login-copy {
  max-width: 38ch;
  margin: 0 0 26px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.stack-form,
.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 5px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 10px;
  font-size: 0.86rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-faint);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.form-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 0.8rem;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 13px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.button:hover {
  border-color: var(--ink-muted);
  background: var(--surface-muted);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: oklch(0.98 0.004 28);
}

.button.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
}

.button.small {
  min-height: 31px;
  padding: 6px 9px;
  font-size: 0.74rem;
}

.button.full {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  transition: background var(--transition), color var(--transition);
}

.icon-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button.on-dark {
  color: var(--sidebar-muted);
}

.icon-button.on-dark:hover {
  background: oklch(1 0 0 / 0.08);
  color: oklch(0.94 0.006 165);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 20px 13px 14px;
  background: var(--sidebar);
  color: oklch(0.94 0.006 165);
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 24px;
}

.brand img {
  width: 112px;
  height: auto;
}

.brand span {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.primary-nav {
  display: grid;
  gap: 3px;
}

.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  border-radius: 9px;
  background: transparent;
  padding: 9px 11px;
  color: var(--sidebar-muted);
  font-size: 0.84rem;
  font-weight: 640;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover {
  background: oklch(1 0 0 / 0.06);
  color: oklch(0.95 0.006 165);
}

.nav-item.active {
  background: var(--accent);
  color: oklch(0.98 0.004 28);
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 7px 2px;
  border-top: 1px solid oklch(1 0 0 / 0.09);
}

.user-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: oklch(1 0 0 / 0.1);
  color: oklch(0.95 0.006 165);
  font-size: 0.72rem;
  font-weight: 800;
}

.user-copy {
  min-width: 0;
}

.user-copy strong,
.user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 0.76rem;
  font-weight: 700;
}

.user-copy span {
  margin-top: 1px;
  color: var(--sidebar-muted);
  font-size: 0.66rem;
  text-transform: capitalize;
}

.workspace {
  min-width: 0;
  padding: 30px clamp(20px, 3vw, 42px) 60px;
}

.workspace-header {
  display: flex;
  min-height: 74px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 25px;
  max-width: 1420px;
}

.workspace-header h1 {
  margin: 3px 0 2px;
  font-size: 1.62rem;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.workspace-header p:last-child {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 5px;
}

.content {
  max-width: 1420px;
  margin: 0 auto;
}

.loading-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.summary-strip {
  display: flex;
  align-items: stretch;
  border-block: 1px solid var(--line);
  margin-bottom: 28px;
}

.summary-item {
  display: grid;
  min-width: 140px;
  flex: 1;
  gap: 2px;
  border-right: 1px solid var(--line);
  padding: 14px 18px;
  background: transparent;
  text-align: left;
}

.summary-item:first-child {
  padding-left: 0;
}

.summary-item:last-child {
  border-right: 0;
}

button.summary-item:hover strong {
  color: var(--accent-strong);
}

.summary-item strong {
  font-size: 1.24rem;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.summary-item span {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 26px;
}

.work-column {
  display: grid;
  align-content: start;
  gap: 28px;
}

.section {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 0.94rem;
  letter-spacing: -0.015em;
}

.section-heading span,
.section-heading button {
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.section-heading button {
  background: transparent;
  font-weight: 700;
}

.section-heading button:hover {
  color: var(--accent-strong);
}

.work-list,
.record-list,
.timeline,
.task-list,
.comment-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-list {
  border-top: 1px solid var(--line);
}

.work-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 4px;
  text-align: left;
  transition: background var(--transition);
}

.work-row:hover {
  background: var(--surface);
}

.work-row-main {
  min-width: 0;
}

.work-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 700;
}

.work-row-title > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-row-detail {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-row-meta {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--ink-faint);
  font-size: 0.69rem;
  text-align: right;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  color: var(--ink-muted);
  font-size: 0.8rem;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.pill {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--surface-strong);
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 780;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill.success,
.pill.active,
.pill.done,
.pill.won,
.pill.resolved,
.pill.complete {
  background: var(--success-soft);
  color: oklch(0.42 0.1 153);
}

.pill.warning,
.pill.high,
.pill.proposal,
.pill.waiting_customer,
.pill.documents,
.pill.procurement,
.pill.porting {
  background: var(--warning-soft);
  color: oklch(0.48 0.11 78);
}

.pill.danger,
.pill.urgent,
.pill.blocked,
.pill.rejected,
.pill.lost {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill.info,
.pill.new,
.pill.contacted,
.pill.in_progress,
.pill.testing,
.pill.cutover,
.pill.cutover_scheduled {
  background: var(--info-soft);
  color: oklch(0.45 0.11 250);
}

.pill.purple,
.pill.discovery,
.pill.solution_design,
.pill.design,
.pill.training {
  background: var(--purple-soft);
  color: oklch(0.46 0.1 310);
}

.pill.neutral,
.pill.low,
.pill.closed,
.pill.cancelled,
.pill.waiting_vendor {
  background: var(--surface-strong);
  color: var(--ink-muted);
}

.priority-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--line-strong);
}

.priority-dot.urgent {
  background: var(--danger);
}

.priority-dot.high {
  background: var(--warning);
}

.priority-dot.normal {
  background: var(--info);
}

.priority-dot.low {
  background: var(--ink-faint);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  width: min(320px, 45vw);
  padding-left: 12px;
}

.filter-select {
  width: auto;
  min-width: 150px;
}

.pipeline-board {
  display: grid;
  grid-auto-columns: minmax(230px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding: 0 0 14px;
  scroll-snap-type: x proximity;
}

.pipeline-lane {
  min-width: 0;
  scroll-snap-align: start;
}

.lane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-strong);
  padding: 0 3px 9px;
}

.lane-heading h2 {
  margin: 0;
  font-size: 0.78rem;
}

.lane-heading span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 750;
}

.lane-cards {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 9px;
}

.deal-card {
  display: grid;
  width: 100%;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color var(--transition), transform var(--transition);
}

.deal-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.deal-card h3 {
  overflow: hidden;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.72rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.deal-card-meta,
.record-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 0.67rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.64rem;
  font-weight: 780;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr[data-open] {
  cursor: pointer;
}

tbody tr[data-open]:hover {
  background: var(--accent-soft);
}

td.primary-cell {
  max-width: 320px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 690;
  text-overflow: ellipsis;
}

td.muted-cell {
  color: var(--ink-muted);
}

td.number-cell,
th.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.project-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(130px, 0.7fr) minmax(150px, 0.8fr) minmax(160px, 1fr) 105px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 14px 6px;
  text-align: left;
  transition: background var(--transition);
}

.project-row:hover {
  background: var(--surface);
}

.project-title {
  min-width: 0;
}

.project-title strong,
.project-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-title strong {
  font-size: 0.84rem;
}

.project-title span {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.progress {
  display: grid;
  gap: 5px;
}

.progress-native {
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-strong);
  appearance: none;
}

.progress-native::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--surface-strong);
}

.progress-native::-webkit-progress-value {
  border-radius: inherit;
  background: var(--success);
}

.progress-native::-moz-progress-bar {
  border-radius: inherit;
  background: var(--success);
}

.progress-label {
  color: var(--ink-faint);
  font-size: 0.65rem;
}

.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 26px;
}

.queue-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.ticket-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1.5fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) 90px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 5px;
  text-align: left;
}

.ticket-row:hover {
  background: var(--surface);
}

.ticket-title {
  min-width: 0;
}

.ticket-title strong,
.ticket-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-title strong {
  font-size: 0.82rem;
}

.ticket-title span {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.attention-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px;
}

.attention-panel h2 {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.attention-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  font-size: 0.75rem;
}

.attention-item:first-of-type {
  border-top: 0;
}

.attention-item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.78rem;
}

.attention-item span {
  color: var(--ink-muted);
}

.table-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.table-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent-strong);
}

.text-button.danger {
  color: var(--danger);
}

.section-copy {
  margin: -4px 0 18px;
  color: var(--ink-muted);
}

.preserve-lines {
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: oklch(0.2 0.01 165 / 0.34);
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 90;
  width: min(720px, calc(100vw - 32px));
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--canvas);
  box-shadow: -18px 0 42px oklch(0.2 0.01 165 / 0.15);
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(0.25, 1, 0.5, 1);
}

.drawer.open {
  transform: translateX(0);
}

.drawer.wide {
  width: min(900px, calc(100vw - 32px));
}

.drawer-close {
  position: sticky;
  top: 12px;
  z-index: 2;
  float: right;
  margin: 12px 14px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.drawer-content {
  padding: 32px 34px 60px;
}

.drawer-header {
  margin-right: 42px;
  margin-bottom: 24px;
}

.drawer-header h2 {
  margin: 5px 0 5px;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.028em;
}

.drawer-header p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.detail-section {
  margin-top: 28px;
}

.detail-section > h3 {
  margin: 0 0 11px;
  font-size: 0.88rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
}

.detail-pair {
  min-width: 0;
}

.detail-pair span,
.detail-pair strong {
  display: block;
}

.detail-pair span {
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.detail-pair strong {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
}

.detail-note {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 13px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.task-list {
  border-top: 1px solid var(--line);
}

.task-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
}

.task-check {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin: 1px 0 0;
  accent-color: var(--success);
}

.task-copy {
  min-width: 0;
}

.task-copy strong,
.task-copy span {
  display: block;
}

.task-copy strong {
  font-size: 0.78rem;
}

.task-copy span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 0.67rem;
}

.task-item.done .task-copy strong {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.inline-form label {
  flex: 1;
}

.timeline {
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
}

.timeline-time {
  color: var(--ink-faint);
  font-size: 0.65rem;
}

.timeline-copy {
  color: var(--ink-muted);
  font-size: 0.75rem;
  white-space: pre-wrap;
}

.timeline-copy strong {
  color: var(--ink);
}

.comment-list {
  gap: 10px;
}

.comment {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px;
}

.comment.public {
  background: var(--info-soft);
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-size: 0.66rem;
}

.comment-head strong {
  color: var(--ink);
}

.comment-body {
  color: var(--ink-muted);
  font-size: 0.76rem;
  white-space: pre-wrap;
}

.subtabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 0 0 20px;
}

.subtab {
  min-height: 36px;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 8px 10px;
  color: var(--ink-muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.subtab.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.asset-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(100px, 0.7fr) minmax(100px, 0.8fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  color: var(--ink-muted);
  font-size: 0.73rem;
}

.asset-row strong {
  color: var(--ink);
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  border-block: 1px solid var(--line);
  margin-bottom: 26px;
}

.finance-stat {
  border-right: 1px solid var(--line);
  padding: 15px 18px;
}

.finance-stat:first-child {
  padding-left: 0;
}

.finance-stat:last-child {
  border-right: 0;
}

.finance-stat strong,
.finance-stat span {
  display: block;
}

.finance-stat strong {
  font-size: 1.12rem;
}

.finance-stat span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--ink);
  padding: 11px 13px;
  box-shadow: var(--shadow-md);
  color: oklch(0.96 0.005 165);
  font-size: 0.78rem;
  animation: toast-in var(--transition);
}

.toast.error {
  background: oklch(0.36 0.09 28);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .work-grid,
  .support-layout {
    grid-template-columns: 1fr;
  }

  .project-row {
    grid-template-columns: minmax(220px, 1.4fr) 120px minmax(140px, 0.8fr) 90px;
  }

  .project-row .project-owner {
    display: none;
  }

  .ticket-row {
    grid-template-columns: 12px minmax(0, 1.5fr) minmax(110px, 0.7fr) 90px;
  }

  .ticket-row .ticket-assignee {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    display: grid;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
  }

  .brand {
    padding: 0;
  }

  .brand img {
    width: 90px;
  }

  .primary-nav {
    display: flex;
    overflow-x: auto;
    gap: 2px;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    min-height: 38px;
    flex: none;
    padding: 8px 10px;
  }

  .nav-item svg {
    width: 17px;
    height: 17px;
  }

  .sidebar-footer {
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .user-badge,
  .user-copy {
    display: none;
  }

  .workspace {
    padding-top: 22px;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding-inline: 15px;
  }

  .workspace-header {
    display: grid;
    margin-bottom: 18px;
  }

  .header-actions {
    padding-top: 0;
  }

  .summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-item,
  .summary-item:first-child {
    border-right: 1px solid var(--line);
    padding: 11px 10px;
  }

  .summary-item:nth-child(even) {
    border-right: 0;
  }

  .summary-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-group {
    width: 100%;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  .project-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .project-row .project-phase,
  .project-row .project-progress,
  .project-row .project-owner {
    display: none;
  }

  .ticket-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }

  .ticket-row .ticket-status,
  .ticket-row .ticket-assignee {
    display: none;
  }

  .drawer,
  .drawer.wide {
    width: 100%;
  }

  .drawer-content {
    padding: 26px 18px 50px;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-stat,
  .finance-stat:first-child {
    border-bottom: 1px solid var(--line);
    padding: 11px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Item 4 (NOTES-FROM-JARED): required fields are marked before you hit save.
   Driven off the real required attribute so the mark can never lie. */
label:has(> input[required]) > span::after,
label:has(> select[required]) > span::after,
label:has(> textarea[required]) > span::after,
label:has(span + input[required]) > span::after,
label:has(span + textarea[required]) > span::after {
  content: ' *';
  color: var(--danger, #b5392c);
  font-weight: 700;
}
form:has([required])::before {
  content: 'Fields marked * are required';
  display: block;
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--muted, #6b7280);
  letter-spacing: 0.02em;
}

/* Item 8: attachment chips + inline screenshot galleries */
.attach-zone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; grid-column: 1 / -1; margin-top: -4px; }
.attach-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; border: 1px solid var(--line, #d6d3cd); border-radius: 8px; padding: 3px 8px; background: var(--panel, #fff); }
.attach-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }
.attach-chip button { border: 0; background: none; cursor: pointer; font-size: 0.95rem; line-height: 1; color: inherit; }
.attach-pick { cursor: pointer; }
.attach-msg { font-size: 0.75rem; color: var(--muted, #6b7280); }
.attach-gallery { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.attach-gallery img { max-width: 260px; max-height: 180px; border-radius: 10px; border: 1px solid var(--line, #d6d3cd); display: block; }
