:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #1d252c;
  --muted: #65717c;
  --line: #dce2e7;
  --line-strong: #c5ced6;
  --teal: #087f6f;
  --teal-dark: #075d55;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app-shell {
  display: grid;
  gap: 18px;
  padding: 24px 32px 42px;
}

.topbar,
.guide-bar,
.filter-band,
.task-surface {
  background: var(--surface);
  border: 1px solid var(--line);
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.guide-bar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 14px 18px;
}

.guide-link-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  min-width: 420px;
}

.guide-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
}

.guide-link:not(.is-disabled):hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.guide-link.is-disabled {
  background: #f8fafb;
  color: #9ba6b0;
}

.primary-button,
.ghost-button {
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  height: 36px;
  padding: 0 14px;
}

.top-actions .primary-button,
.top-actions .ghost-button,
.top-actions .tab-button,
.top-actions .save-button {
  white-space: nowrap;
}

.top-actions .primary-button {
  background: #1d252c;
  border-color: #1d252c;
  color: #ffffff;
}

.top-actions .primary-button:hover {
  background: #2b3945;
  border-color: #2b3945;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
}

.ghost-button {
  background: #ffffff;
  border-color: var(--line-strong);
  color: var(--ink);
}

.primary-button:disabled,
.ghost-button:disabled,
.tab-button:disabled {
  background: #eef1f4;
  border-color: #d8e0e6;
  color: #8a97a3;
  cursor: not-allowed;
}

.sync-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 8px 10px;
  white-space: nowrap;
}

.sync-status.is-online {
  background: #ecf6f4;
  border-color: #c7e6df;
  color: var(--teal-dark);
}

.sync-status.is-syncing {
  background: #fff7e6;
  border-color: #edd19a;
  color: #8a5b08;
}

.sync-status.is-error {
  background: #fff0f0;
  border-color: #f0c8c8;
  color: #a43b3b;
}

.sync-status.is-local {
  background: #f8fafb;
}

.auth-modal {
  align-items: center;
  background: rgba(29, 37, 44, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 100;
}

.auth-modal[hidden] {
  display: none;
}

.auth-dialog {
  background: #ffffff;
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  max-width: 360px;
  padding: 22px;
  width: 100%;
}

.auth-dialog p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-dialog label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-dialog input {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  height: 40px;
  padding: 0 12px;
}

.auth-error {
  color: #a43b3b;
  min-height: 20px;
}

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

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

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.filter-band {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px;
}

.view-tabs {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.tab-group {
  display: flex;
  gap: 8px;
}

.tab-button,
.save-button {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  height: 36px;
  padding: 0 14px;
}

a.tab-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.tab-button.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.save-button {
  background: #eef1f4;
  border-color: #d8e0e6;
  color: #8a97a3;
  cursor: not-allowed;
}

.save-button.is-dirty {
  background: #b78113;
  border-color: #b78113;
  color: #ffffff;
  cursor: pointer;
}

.save-button.is-saved:disabled {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.control-group {
  display: grid;
  flex: 0 0 180px;
  gap: 6px;
}

.control-group.is-hidden {
  display: none;
}

.control-group:nth-child(1),
#languageControl {
  flex-basis: 132px;
}

.control-group:nth-child(5),
.control-group:nth-child(6) {
  flex-basis: 220px;
}

.control-group label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.control-group label[for="phaseFilter"] {
  font-weight: 700;
}

.control-group select {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  height: 42px;
  padding: 0 12px;
  width: 100%;
}

.section-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}

.task-surface[data-panel="dashboard"] .section-heading {
  min-height: 70px;
}

.task-surface[data-panel="dashboard"] .eyebrow {
  letter-spacing: 0;
  margin-bottom: 4px;
  text-transform: none;
}

.count-pill {
  background: #ecf6f4;
  border-radius: 999px;
  color: var(--teal-dark);
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  min-width: 52px;
  padding: 6px 10px;
  text-align: center;
}

.task-list {
  padding: 18px 28px 24px;
}

.table-wrap {
  overflow: auto;
  padding: 18px;
}

.table-wrap.compact {
  padding: 0;
}

.dashboard-table,
.management-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.management-table {
  min-width: 1280px;
}

.dashboard-table th,
.dashboard-table td,
.management-table th,
.management-table td {
  border: 1px solid var(--line);
  font-size: 13px;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.dashboard-table th,
.management-table th {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-table th:first-child,
.dashboard-table td:first-child,
.management-table th:first-child,
.management-table td:first-child {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  width: 54px;
}

.primary-cell {
  color: var(--ink);
  font-weight: 760;
}

.parallel-board {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.phase-column {
  background: #f8fafb;
  border: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.phase-heading,
.group-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
}

.phase-heading strong,
.group-heading strong {
  font-size: 14px;
  line-height: 1.35;
}

.phase-heading span,
.group-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.group-grid {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  padding: 12px;
}

.group-column {
  background: #ffffff;
  border: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.group-heading {
  background: #ffffff;
}

.output-grid {
  align-content: start;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  padding: 10px;
}

.output-column {
  background: #ffffff;
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px 18px 14px;
}

.output-column h3 {
  font-size: 14px;
  line-height: 1.35;
}

.size-stack,
.meta-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-group {
  display: grid;
  gap: 6px;
}

.meta-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.size-stack span,
.meta-stack span {
  background: #ecf6f4;
  border-radius: 999px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
}

.meta-stack span {
  background: #eef1f4;
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  color: var(--muted);
  padding: 50px 20px;
  text-align: center;
}

.discussion-state {
  align-items: center;
  background: #f8fafb;
  border: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 180px;
  padding: 42px 24px;
  text-align: center;
}

.discussion-state strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
}

.discussion-state span {
  font-size: 13px;
  line-height: 1.5;
}

.timeline-dashboard {
  display: grid;
  gap: 14px;
}

.timeline-phase {
  background: #ffffff;
  border: 2px solid var(--timeline-phase-border);
}

.timeline-phase-header {
  align-items: center;
  background: var(--timeline-phase-bg);
  border-bottom: 1px solid var(--timeline-phase-border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 13px 16px;
}

.timeline-phase-title {
  color: var(--timeline-phase-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.32;
}

.timeline-phase-header span,
.timeline-group-header span,
.timeline-variant-list span {
  background: #f3f4f8;
  color: #5f6470;
  display: inline-flex;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}

.timeline-variant-list.is-owner span {
  background: #fff3dc;
  color: #8c5d13;
}

.timeline-phase-header span {
  background: rgba(255, 255, 255, 0.72);
  color: var(--timeline-phase-ink);
  white-space: nowrap;
}

.timeline-group-grid {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
}

.timeline-group {
  border: 1px solid var(--timeline-group-border);
  border-left: 4px solid var(--timeline-group-color);
  min-width: 0;
}

.timeline-group-header {
  align-items: center;
  background: var(--timeline-group-bg);
  border-bottom: 1px solid var(--timeline-group-border);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.timeline-group-header h4 {
  color: var(--timeline-group-color);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
}

.timeline-group-header span {
  background: #ffffff;
  color: var(--timeline-group-color);
  white-space: nowrap;
}

.timeline-output-list {
  display: grid;
}

.timeline-output-row {
  align-items: flex-start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px;
}

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

.timeline-output-row strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.timeline-output-main {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.timeline-variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-extension-note {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  padding-top: 1px;
  white-space: nowrap;
}

.management-table {
  min-width: 1540px;
}

.is-hidden-row {
  background: #f8fafb;
  color: var(--muted);
}

.table-input,
.table-select {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  font: inherit;
  height: 32px;
  min-width: 72px;
  padding: 0 8px;
  width: 100%;
}

.table-select {
  min-width: 58px;
}

.memo-input {
  min-width: 180px;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px;
  }

  .filter-band {
    grid-template-columns: 1fr;
  }

  .topbar,
  .guide-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .guide-link-list {
    min-width: 0;
    width: 100%;
  }

}

@media (max-width: 480px) {
  .timeline-phase-header,
  .timeline-group-header {
    align-items: flex-start;
    display: grid;
  }

  .timeline-group-grid {
    grid-template-columns: 1fr;
  }
}
