:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --surface-3: #f1ede5;
  --ink: #171717;
  --muted: #69655f;
  --line: rgba(35, 35, 39, 0.12);
  --line-strong: rgba(35, 35, 39, 0.2);
  --green: #232327;
  --green-dark: #111214;
  --green-soft: #f7f5f0;
  --amber: #6f543c;
  --red: #b75b61;
  --blueprint: #f6f4ef;
  --blueprint-line: #d6d0c7;
  --sidebar: #ffffff;
  --sidebar-2: #f7f5f0;
  --sidebar-line: rgba(35, 35, 39, 0.08);
  --shadow: 0 24px 70px rgba(31, 28, 24, 0.1);
  --shadow-strong: 0 24px 70px rgba(31, 28, 24, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

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

.main-content-section,
.team-content {
  display: grid;
  gap: 18px;
}

.main-content-section.hidden,
.team-content.hidden {
  display: none;
}

.team-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.team-tabs {
  display: flex;
  gap: 12px;
}

.team-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.team-panel.hidden {
  display: none;
}

.team-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.team-week-picker {
  display: grid;
  gap: 6px;
  min-width: 160px;
  font-size: 13px;
  color: var(--muted);
}

.team-summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 700;
}

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

.team-history-panel {
  display: grid;
  gap: 12px;
}

.team-saved-weeks-list {
  display: grid;
  gap: 10px;
}

.team-saved-week-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.team-saved-week-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.team-saved-week-title {
  font-size: 14px;
  font-weight: 800;
}

.team-saved-week-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.team-saved-week-total {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 800;
  white-space: nowrap;
}

.team-saved-week-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.team-saved-week-empty {
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.team-table {
  width: 100%;
  min-width: 1140px;
  border-collapse: collapse;
}

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

.team-table thead th,
.team-table tfoot td {
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 800;
}

.team-table td input,
.team-table td select {
  width: 100%;
}

.team-table .team-day-start td {
  border-top: 2px solid var(--line);
}

.team-table .team-day-start:first-child td {
  border-top: 0;
}

.team-actions-cell {
  width: 170px;
}

.team-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.team-mini-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.team-mini-button.danger {
  border-color: rgba(187, 79, 90, 0.24);
  color: var(--accent);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 18px;
  border-right: 1px solid var(--sidebar-line);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--ink);
}

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 6px 4px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: clamp(180px, 20vw, 250px);
  max-width: 100%;
  height: auto;
}

.brand-copy {
  display: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.brand-row p,
.hint,
.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--red);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar .brand-row p,
.sidebar .hint {
  color: var(--muted);
}

.panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.panel.compact {
  padding: 12px;
}

.panel-title,
.topbar,
.toolbar,
.dialog-title,
.dialog-actions,
.top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--ink);
}

.project-list,
.member-list,
.task-list,
.checklist-list,
.stack {
  display: grid;
  gap: 10px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.project-group {
  display: grid;
  gap: 8px;
}

.project-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.project-group-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.project-group-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-group-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-group-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-group-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.project-group-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.project-group-list {
  display: grid;
  gap: 8px;
}

.project-group-toolbar,
.project-subgroup-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 4px 32px;
}

.project-group-toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.project-group-toolbar-button.danger {
  color: var(--danger);
  border-color: rgba(183, 91, 97, 0.35);
}

.project-subgroup {
  display: grid;
  gap: 8px;
  margin-left: 18px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.project-subgroup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.project-subgroup-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.project-subgroup-list {
  display: grid;
  gap: 8px;
}

.checklist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.project-button,
.member-row,
.task-card,
.check-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-button {
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
  border-color: var(--line);
  background: #fffdfa;
}

.project-delete-button {
  align-self: center;
  min-width: 44px;
}

.project-button.active {
  border-color: rgba(183, 91, 97, 0.28);
  background: #fff8f8;
  box-shadow: inset 3px 0 0 var(--red);
}

.project-button strong,
.task-card strong {
  font-size: 14px;
}

.project-button span,
.member-row span,
.task-meta,
.check-row span {
  color: var(--muted);
  font-size: 12px;
}

.task-description-preview {
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-color: var(--line);
  background: #fffdfa;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  min-height: 74px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 18, 19, 0.94), rgba(27, 24, 22, 0.92)),
    linear-gradient(90deg, rgba(17, 17, 18, 0.96), rgba(27, 24, 22, 0.88));
  box-shadow: var(--shadow);
  position: relative;
  color: #fff;
}

.topbar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--red);
}

.topbar h2 {
  margin-top: 3px;
  font-size: 27px;
  line-height: 1.15;
  color: #fff;
}

.topbar-tabs {
  margin-bottom: 0;
  margin-left: auto;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.topbar-tabs .workspace-tab {
  min-width: 104px;
  color: rgba(255, 255, 255, 0.76);
}

.topbar-tabs .workspace-tab.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: none;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.workspace-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.workspace-tab {
  min-width: 120px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.workspace-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(29, 37, 33, 0.08);
}

.workspace-view {
  display: none;
}

.workspace-view.active {
  display: block;
}

.board-panel,
.checklist-panel,
.access-panel,
.gallery-panel,
.plan-panel,
.details-panel,
.status-sidebar-panel,
.task-workspace-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.board-panel {
  margin-bottom: 18px;
}

.checklist-panel {
  margin-bottom: 18px;
}

.access-panel {
  margin-bottom: 18px;
}

.gallery-panel {
  margin-bottom: 18px;
}

.toolbar {
  margin-bottom: 12px;
}

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

.plan-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.plan-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.plan-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.plan-warning {
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid #e3c998;
  border-radius: 8px;
  background: #fff8e8;
  color: #6f5122;
  font-size: 12px;
  line-height: 1.35;
}

.plan-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f2 100%);
}

.plan-card.selected {
  border-color: rgba(183, 91, 97, 0.26);
  box-shadow: 0 0 0 1px rgba(183, 91, 97, 0.12);
}

.plan-card-thumb-wrap {
  position: relative;
  width: 132px;
  height: 170px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #eef2f0;
}

.plan-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #eef2f0;
}

.plan-card-pin-layer {
  position: absolute;
  inset: 0;
}

.plan-card-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: #247a75;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%);
}

.plan-card-pin.blocked {
  background: var(--amber);
}

.plan-card-pin.done {
  background: var(--red);
}

.plan-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.plan-card-body strong {
  font-size: 14px;
}

.plan-card-body span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.plan-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  grid-column: 2;
}

.plan-card-manage {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  grid-column: 2;
}

.plan-card-display-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  grid-column: 2;
}

.plan-file-select {
  min-width: 0;
  padding-right: 34px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

.segmented,
.tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.segment,
.tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
  white-space: nowrap;
}

.segment.active,
.tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(29, 37, 33, 0.08);
}

.plan-preview-gallery {
  display: grid;
  gap: 16px;
}

.large-plan-view {
  display: grid;
  gap: 10px;
}

.large-plan-view-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.large-plan-view-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  min-width: 0;
}

.large-plan-view-header strong {
  font-size: 16px;
}

.large-plan-view-header span {
  color: var(--muted);
  font-size: 12px;
}

.large-plan-canvas {
  position: relative;
  overflow: hidden;
  min-height: 700px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(159, 176, 186, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(159, 176, 186, 0.18) 1px, transparent 1px),
    var(--blueprint);
  background-size: 38px 38px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.large-plan-canvas.selected {
  border-color: rgba(183, 91, 97, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 0 0 1px rgba(183, 91, 97, 0.12);
}

.large-plan-canvas.document-view {
  min-height: 960px;
  background: #eef1f5;
}

.plan-preview-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4f6f5;
  z-index: 0;
}

.plan-preview-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f4f6f5;
  z-index: 0;
}

.large-plan-canvas.has-plan .grid-lines,
.large-plan-canvas.has-plan .room {
  display: none;
}

.grid-lines {
  position: absolute;
  inset: 18px;
  border: 3px solid #495b63;
  border-radius: 4px;
}

.room {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid #495b63;
  color: #40545d;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.room-a {
  inset: 58px auto auto 58px;
  width: 34%;
  height: 31%;
}

.room-b {
  inset: 58px 58px auto auto;
  width: 48%;
  height: 18%;
}

.room-c {
  inset: 230px 58px auto auto;
  width: 48%;
  height: 32%;
}

.room-d {
  left: 58px;
  bottom: 58px;
  width: 31%;
  height: 31%;
}

.room-e {
  right: 58px;
  bottom: 58px;
  width: 31%;
  height: 22%;
}

.room-f {
  left: 41%;
  bottom: 58px;
  width: 20%;
  height: 22%;
}

.pin-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.pin {
  position: absolute;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 18px rgba(20, 28, 24, 0.22);
}

.pin.editable {
  cursor: grab;
}

.large-plan-canvas.dragging-pin .pin.editable {
  cursor: grabbing;
}

.pin.dragging {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 14px 28px rgba(20, 28, 24, 0.28);
}

.pin.selected {
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.96),
    0 0 0 6px rgba(31, 111, 235, 0.28),
    0 14px 28px rgba(20, 28, 24, 0.28);
  transform: translate(-50%, -50%) scale(1.08);
}

.pin.open {
  background: #266f66;
}

.pin.blocked {
  background: var(--red);
}

.pin.done {
  background: #70685d;
}

.selection-box {
  position: absolute;
  border: 2px dashed #1f6feb;
  background: rgba(31, 111, 235, 0.18);
  z-index: 2;
  pointer-events: none;
}

.pin-color-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

#taskColorInput {
  width: 56px;
  min-width: 56px;
  height: 38px;
  padding: 4px;
}

.pin-color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 24px;
  height: 24px;
  min-height: 24px;
  min-width: 24px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: var(--swatch);
  box-shadow: 0 2px 8px rgba(20, 28, 24, 0.18);
}

.color-swatch.active {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.details-panel {
  display: grid;
  gap: 12px;
}

.status-sidebar-panel {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 22px;
}

.task-workspace-panel {
  display: grid;
  gap: 12px;
}

.status-panel-inline,
.task-panel-inline {
  display: grid;
  gap: 12px;
}

.task-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  text-align: left;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f2 100%);
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  line-height: 1.5;
}

.task-card.selected {
  border-color: rgba(183, 91, 97, 0.26);
  box-shadow: inset 3px 0 0 var(--red);
}

.task-card header,
.task-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.check-row strong {
  display: block;
  font-size: 14px;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.check-row-meta {
  color: var(--muted);
  font-size: 12px;
}

.access-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.8fr);
  gap: 10px;
  margin-bottom: 12px;
}

.access-project-picker {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.project-chip.active {
  border-color: rgba(183, 91, 97, 0.28);
  background: #fff8f8;
  box-shadow: inset 0 0 0 1px rgba(183, 91, 97, 0.18);
}

.project-chip.muted {
  background: #fbf8f2;
  color: var(--muted);
}

.access-list {
  display: grid;
  gap: 10px;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 170px) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f2 100%);
}

.access-row.blocked {
  border-color: #f0c8c0;
  background: #fff7f5;
}

.access-row strong {
  display: block;
  font-size: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.access-row span {
  color: var(--muted);
  font-size: 12px;
}

.access-row-info {
  min-width: 0;
}

.access-member-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.access-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.access-role-select {
  min-height: 38px;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.status-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f2 100%);
  text-align: left;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.status-card.active {
  border-color: rgba(183, 91, 97, 0.28);
  background: #fff8f8;
  box-shadow: inset 3px 0 0 var(--red);
}

.status-card:hover {
  border-color: var(--line-strong);
}

.status-board strong {
  font-size: 28px;
}

.status-board span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.neutral {
  background: #66736f;
}

.badge.viewer {
  background: #586b82;
}

.badge.editor {
  background: var(--red);
}

.badge.owner {
  background: var(--amber);
}

.badge.blocked {
  background: var(--red);
}

.badge.high,
.badge.blocked {
  background: var(--red);
}

.badge.normal,
.badge.open {
  background: var(--green);
}

.badge.low,
.badge.done {
  background: #70685d;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 12px;
  font-weight: 800;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.primary-button {
  background: var(--red);
  color: #fff;
  box-shadow: 0 18px 42px rgba(183, 91, 97, 0.24);
}

.primary-button:hover {
  background: #843e43;
}

.secondary-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.topbar .secondary-button,
.topbar .icon-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.secondary-button:hover,
.icon-button:hover,
.ghost-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.topbar .secondary-button:hover,
.topbar .icon-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
}

.danger-button {
  background: #fff0ed;
  border-color: #f0c8c0;
  color: var(--red);
}

.icon-button {
  width: 38px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

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

svg {
  width: 17px;
  height: 17px;
}

i[data-lucide] {
  display: inline-grid;
  min-width: 17px;
  min-height: 17px;
  place-items: center;
  font-style: normal;
  line-height: 1;
}

i[data-lucide="plus"]::before,
i[data-lucide="folder-plus"]::before,
i[data-lucide="map-pin-plus"]::before,
i[data-lucide="user-plus"]::before,
i[data-lucide="image-plus"]::before {
  content: "+";
}

i[data-lucide="x"]::before {
  content: "x";
}

i[data-lucide="refresh-cw"]::before {
  content: "R";
}

i[data-lucide="download"]::before {
  content: "D";
}

i[data-lucide="trash-2"]::before {
  content: "×";
}

i[data-lucide="save"]::before,
i[data-lucide="shield-check"]::before,
i[data-lucide="log-in"]::before {
  content: "OK";
}

i[data-lucide="log-out"]::before {
  content: "<";
}

i[data-lucide="shield-x"]::before {
  content: "!";
}

i[data-lucide="message-square"]::before {
  content: "..";
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 11px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(183, 91, 97, 0.34);
  box-shadow: 0 0 0 3px rgba(183, 91, 97, 0.14);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow-strong);
}

dialog::backdrop {
  background: rgba(20, 28, 24, 0.38);
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-title h3 {
  font-size: 19px;
}

.dialog-title.compact {
  justify-content: flex-start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dialog-actions.right {
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

.print-report {
  display: none;
}

.print-report-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  color: #171717;
  background: #fff;
}

.print-report-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #d9d3c8;
}

.print-report-logo {
  width: 220px;
  height: auto;
}

.print-report-code {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.print-report-header h1 {
  margin: 6px 0 4px;
  font-size: 32px;
  line-height: 1.1;
}

.print-report-header p,
.print-plan-heading p {
  color: #5d5953;
}

.print-report-checklist,
.print-report-plans {
  margin-bottom: 24px;
}

.print-report-checklist h2,
.print-plan-heading h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.print-checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.print-check-item {
  padding: 12px;
  border: 1px solid #d9d3c8;
  border-radius: 8px;
  background: #fbf8f2;
}

.print-check-state {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #5d5953;
  text-transform: uppercase;
}

.print-plan-section {
  page-break-inside: avoid;
  margin-bottom: 28px;
}

.print-plan-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.print-plan-canvas {
  position: relative;
  border: 1px solid #d9d3c8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 14px;
}

.print-plan-image {
  display: block;
  width: 100%;
  height: auto;
}

.print-pin-layer {
  position: absolute;
  inset: 0;
}

.print-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.print-task-table {
  border: 1px solid #d9d3c8;
  border-radius: 8px;
  overflow: hidden;
}

.print-task-table-head,
.print-task-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1.2fr) 120px 140px;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
}

.print-task-table-head {
  background: #f3eee5;
  font-weight: 700;
}

.print-task-row {
  border-top: 1px solid #ebe4d9;
}

@media print {
  body.printing-report {
    background: #fff;
  }

  body.printing-report .app-shell,
  body.printing-report dialog {
    display: none !important;
  }

  body.printing-report .print-report {
    display: block !important;
  }

  body.printing-report .print-report.hidden {
    display: block !important;
  }

  .print-report-inner {
    max-width: none;
    padding: 0;
  }
}

.board-form,
.board-list,
.task-comments-list {
  display: grid;
  gap: 12px;
}

.board-form-actions,
.task-approval-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.board-card,
.task-comment-card,
.task-collab-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.board-card {
  overflow: hidden;
}

.board-card-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  background: var(--surface-3);
}

.board-card-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.board-card-meta,
.task-comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.board-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.task-collab-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.task-approval-row {
  display: grid;
  gap: 10px;
}

.task-comments-panel {
  display: grid;
  gap: 12px;
}

.task-comment-card {
  padding: 12px;
}

.task-comment-body {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.task-comment-composer {
  display: grid;
  gap: 10px;
}

.app-shell.auth-only {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.auth-only .workspace,
.app-shell.auth-only .panel:not(.compact) {
  display: none;
}

.app-shell.auth-only .sidebar {
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  justify-content: center;
  border-right: 0;
  background: transparent;
}

.app-shell.auth-only .brand-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 0;
}

.app-shell.auth-only .brand-logo {
  width: min(320px, 72vw);
}

.app-shell.auth-only .brand-copy h1 {
  font-size: 28px;
}

.app-shell.auth-only .brand-copy p {
  font-size: 15px;
}

.app-shell.auth-only .panel.compact {
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.app-shell.auth-only .panel-title {
  margin-bottom: 16px;
  font-size: 16px;
}

.app-shell.auth-only .stack {
  gap: 12px;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .status-sidebar-panel {
    position: static;
  }

  .plan-library {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .workspace,
  .sidebar {
    padding: 12px;
  }

  .topbar,
  .toolbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions > * {
    width: 100%;
  }

  .content-grid {
    gap: 12px;
  }

  .workspace-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-tabs {
    margin-left: 0;
  }

  .workspace-tab {
    min-width: 0;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .segment {
    flex: 1;
  }

  .plan-canvas {
    min-height: 520px;
  }

  .status-board,
  .form-grid,
  .plan-form,
  .access-form,
  .access-row {
    grid-template-columns: 1fr;
  }

  .task-card header,
  .task-card footer,
  .large-plan-view-header,
  .large-plan-view-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .access-row-actions {
    justify-content: stretch;
  }
}
