/* ==========================================================================

   Design System: Are.na Monochrome Brutalism × Smartsheet High-Density Grid
   ========================================================================== */

:root {
  /* Strict Monochrome Palette */
  --bg-app: #F7F7F5;
  --bg-surface: #FFFFFF;
  --bg-header: #EFEFED;
  --bg-subtle: #F3F3F1;
  --bg-active-row: #F5F5F3;

  --text-primary: #111111;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-inverse: #FFFFFF;

  --border-default: #DCDCDC;
  --border-strong: #111111;
  --border-dashed: #999999;

  /* Heatmap 5-Step Monochrome Scale */
  --hm-lv-0: #EAEAEA;
  --hm-lv-1: #CCCCCC;
  --hm-lv-2: #888888;
  --hm-lv-3: #444444;
  --hm-lv-4: #111111;

  /* Typography */
  --font-sans: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Fixed Top Bars Stack = 48 + 46 + 46 = 140px */
  --gnb-height: 48px;
  --subbar-timer-height: 46px;
  --subbar-deadline-height: 46px;
  --top-stack-height: 140px;
}

/* Reset & Strict Brutalist Constraints (Zero Shadow, Zero Radius) */
*,
*::before,
*::after {
  box-sizing: border-box;
  box-shadow: none !important;
  border-radius: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  margin: 0;
}

button {
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
}

/* Monochrome Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-header);
  border-left: 1px solid var(--border-default);
  border-top: 1px solid var(--border-default);
}

::-webkit-scrollbar-thumb {
  background: #BDBDBD;
  border: 1px solid var(--bg-header);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Typography & Utility Classes */
.mono-num {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
  letter-spacing: -0.02em;
}

.muted-text {
  color: var(--text-muted);
}

.muted-inline {
  color: var(--text-secondary);
  font-size: 11.5px;
}

.meta-label {
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-app);
}

/* ==========================================================================
   Common Buttons & Form Controls (Are.na Minimal Brutalism)
   ========================================================================== */
.btn-mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.08s linear, background-color 0.08s linear, color 0.08s linear;
}

.btn-mono:hover,
.btn-mono:focus-visible {
  border-color: var(--border-strong);
  outline: none;
}

.btn-mono:active {
  background-color: var(--bg-header);
}

.btn-mono-strong {
  border-color: var(--text-secondary);
  font-weight: 600;
}

.btn-mono-invert {
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
  font-weight: 600;
}

.btn-mono-invert:hover,
.btn-mono-invert:focus-visible {
  background-color: #2B2B2B;
  border-color: var(--text-primary);
}

.btn-danger-outline {
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.btn-danger-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background-color: var(--bg-header);
}

.btn-xs {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.mono-select {
  height: 28px;
  padding: 0 8px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  outline: none;
}

.mono-select:hover,
.mono-select:focus {
  border-color: var(--border-strong);
}

/* Monochrome Toggle Switch */
.inline-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: var(--text-secondary);
}

.inline-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-box {
  position: relative;
  width: 28px;
  height: 15px;
  background-color: var(--bg-header);
  border: 1px solid var(--border-default);
}

.switch-box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  background-color: var(--text-secondary);
  transition: transform 0.1s linear, background-color 0.1s linear;
}

.inline-switch:hover .switch-box {
  border-color: var(--border-strong);
}

.inline-switch input:checked + .switch-box {
  background-color: var(--text-primary);
  border-color: var(--text-primary);
}

.inline-switch input:checked + .switch-box::after {
  transform: translateX(13px);
  background-color: var(--text-inverse);
}

.inline-switch input:checked ~ .switch-label {
  color: var(--text-primary);
  font-weight: 600;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 11.5px;
  color: var(--text-secondary);
  user-select: none;
}

.inline-check input {
  accent-color: var(--text-primary);
  width: 13px;
  height: 13px;
  cursor: pointer;
}

/* ==========================================================================
   1. GNB (Global Navigation Bar - 48px)
   ========================================================================== */
.gnb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--gnb-height);
  min-height: var(--gnb-height);
  padding: 0 14px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
}

.gnb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  white-space: nowrap;
  user-select: none;
}

.gnb-divider,
.subbar-sep {
  width: 1px;
  height: 18px;
  background-color: var(--border-default);
  flex-shrink: 0;
}

.channel-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.channel-tabs-wrap::-webkit-scrollbar {
  display: none;
}

.channel-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.channel-tab {
  height: 28px;
  padding: 0 11px;
  background-color: var(--bg-app);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.channel-tab.is-active {
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
  font-weight: 600;
}

.btn-channel-add {
  background-color: var(--bg-app);
  border-style: dashed;
  border-color: var(--text-muted);
  color: var(--text-secondary);
  font-size: 11.5px;
}

.btn-channel-add:hover {
  color: var(--text-primary);
  border-style: solid;
  border-color: var(--border-strong);
}

/* GNB Center View Switcher */
.gnb-center {
  flex: 0 0 auto;
}

.main-view-seg {
  display: inline-flex;
  border: 1px solid var(--border-default);
  background-color: var(--bg-app);
}

.main-view-tab {
  height: 30px;
  padding: 0 14px;
  border: none;
  border-right: 1px solid var(--border-default);
  background-color: var(--bg-app);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.main-view-tab:last-child {
  border-right: none;
}

.main-view-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface);
}

.main-view-tab.is-active {
  background-color: var(--text-primary);
  color: var(--text-inverse);
}

/* GNB Right */
.gnb-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1 1 auto;
}

/* ==========================================================================
   2. Sub-bar 1: Timer & Pomodoro Control Bar (46px)
   ========================================================================== */
.subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-default);
}

.subbar-timer {
  height: var(--subbar-timer-height);
  min-height: var(--subbar-timer-height);
  background-color: var(--bg-app);
}

.timer-controls-left,
.timer-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.timer-status-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--border-default);
  background-color: var(--bg-header);
  color: var(--text-secondary);
  white-space: nowrap;
}

.timer-status-badge.status-writing {
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

.timer-status-badge.status-paused {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px dashed var(--border-strong);
}

.timer-readout-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
}

.timer-clock {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.pomodoro-countdown {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 9px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pomodoro-countdown.is-running {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ==========================================================================
   3. Sub-bar 2: Deadline Reverse-Calculation Ribbon (46px)
   ========================================================================== */
.subbar-deadline {
  height: var(--subbar-deadline-height);
  min-height: var(--subbar-deadline-height);
  background-color: var(--bg-header);
}

.deadline-meta-group {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.dday-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border: 1px solid var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.deadline-info-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.deadline-info-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.deadline-progress-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex: 1 1 320px;
  max-width: 520px;
  min-width: 200px;
}

.progress-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.progress-numbers {
  font-weight: 700;
  color: var(--text-primary);
}

.ribbon-progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

.ribbon-progress-fill {
  height: 100%;
  background-color: var(--text-primary);
  transition: width 0.15s ease-out;
}

.deadline-simulator-callout {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  white-space: nowrap;
}

.callout-text {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.callout-text strong {
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   4A. Main Workspace - Split View (height: calc(100vh - 140px))
   ========================================================================== */
.workspace-split {
  display: flex;
  width: 100%;
  height: calc(100vh - var(--top-stack-height));
  overflow: hidden;
  background-color: var(--bg-app);
}

.panel-sheet {
  display: flex;
  flex-direction: column;
  width: 62%;
  min-width: 0;
  height: 100%;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-default);
}

.sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-default);
}

.sheet-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sheet-view-tab {
  height: 26px;
  padding: 0 10px;
  background-color: var(--bg-app);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.sheet-view-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.sheet-view-tab.is-active {
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
  font-weight: 600;
}

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

.sheet-key-hint {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sheet-key-hint kbd {
  display: inline-block;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.sheet-grid-viewport {
  flex: 1 1 auto;
  overflow: auto;
  background-color: var(--bg-surface);
}

.smartsheet-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background-color: var(--bg-surface);
}

.col-rownum { width: 40px; }
.col-date   { width: 142px; }
.col-day    { width: 48px; }
.col-chars  { width: 112px; }
.col-gauge  { width: 156px; }
.col-ep     { width: 84px; }
.col-time   { width: 92px; }
.col-cph    { width: 106px; }
.col-memo   { width: auto; }

.smartsheet-table th,
.smartsheet-table td {
  height: 33px;
  padding: 0 8px;
  border-right: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  font-size: 12.5px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smartsheet-table th:last-child,
.smartsheet-table td:last-child {
  border-right: none;
}

.sheet-thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 34px;
  background-color: var(--bg-header);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  user-select: none;
}

.sheet-thead th.is-editable-col {
  color: var(--text-primary);
}

.cell-rownum {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 0 !important;
  text-align: center !important;
  background-color: var(--bg-header);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  user-select: none;
}

.cell-day {
  text-align: center !important;
  color: var(--text-secondary);
}

.cell-chars,
.cell-ep,
.cell-time,
.cell-cph {
  text-align: right !important;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sheet-thead th.cell-chars,
.sheet-thead th.cell-ep,
.sheet-thead th.cell-time,
.sheet-thead th.cell-cph {
  text-align: right;
}

.sheet-thead th.cell-day {
  text-align: center;
}

.sheet-row:hover td:not(.cell-rownum) {
  background-color: var(--bg-active-row);
}

.sheet-row.is-today td:not(.cell-rownum) {
  background-color: #FAF9F6;
}

.sheet-row.is-today .cell-date {
  font-weight: 700;
}

.sheet-parent-row td {
  background-color: var(--bg-subtle);
  font-weight: 700;
}

.sheet-parent-row:hover td:not(.cell-rownum) {
  background-color: var(--bg-header);
}

.sheet-child-row .cell-date {
  padding-left: 24px !important;
  color: var(--text-secondary);
}

.tree-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  padding: 0;
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
}

.tree-toggle-btn:hover {
  border-color: var(--border-strong);
}

.cell-editable {
  cursor: cell;
  position: relative;
}

.cell-editable:hover {
  outline: 1px solid var(--border-strong);
  outline-offset: -1px;
}

.cell-editable.is-editing {
  padding: 0 !important;
  outline: 2px solid var(--border-strong) !important;
  outline-offset: -2px;
  background-color: var(--bg-surface) !important;
  z-index: 2;
}

.inline-cell-input {
  width: 100%;
  height: 100%;
  min-height: 31px;
  padding: 0 7px;
  border: none;
  outline: none;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12.5px;
}

.inline-cell-input.is-num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cell-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.cell-gauge-track {
  flex: 1 1 auto;
  height: 7px;
  background-color: var(--bg-header);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

.cell-gauge-fill {
  height: 100%;
  background-color: var(--text-secondary);
}

.cell-gauge-fill.is-achieved {
  background-color: var(--text-primary);
}

.cell-gauge-pct {
  flex: 0 0 38px;
  text-align: right;
  font-size: 11px;
  color: var(--text-secondary);
}

.badge-achieved {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  background-color: var(--text-primary);
  color: var(--text-inverse);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.sheet-tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
  height: 36px;
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-strong);
  border-bottom: none;
  font-weight: 700;
  color: var(--text-primary);
}

.foot-sub {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Right Panel (38%): Dashboard Widget Docking Panel
   ========================================================================== */
.panel-widgets {
  width: 38%;
  min-width: 340px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-app);
  padding: 10px;
}

.widgets-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  transition: border-color 0.08s linear;
}

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

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-default);
}

.widget-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.widget-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  height: 17px;
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.widget-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-count-badge {
  padding: 0 5px;
  height: 17px;
  line-height: 15px;
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  font-size: 10.5px;
  color: var(--text-secondary);
}

.widget-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.widget-meta-stat {
  font-size: 11px;
  color: var(--text-secondary);
}

.mini-seg {
  display: inline-flex;
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
}

.mini-seg-btn {
  height: 20px;
  padding: 0 6px;
  border: none;
  border-right: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  background-color: var(--bg-surface);
}

.mini-seg-btn:last-child {
  border-right: none;
}

.mini-seg-btn:hover {
  color: var(--text-primary);
}

.mini-seg-btn.is-active {
  background-color: var(--text-primary);
  color: var(--text-inverse);
  font-weight: 600;
}

.widget-body {
  padding: 10px;
}

.widget-empty-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.chart-legend-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-secondary);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.line-solid-sample {
  display: inline-block;
  width: 12px;
  border-top: 2px dashed var(--text-primary);
}

.line-dash-sample {
  display: inline-block;
  width: 12px;
  border-top: 1px dotted var(--text-muted);
}

.widget-chart-body {
  padding: 8px 10px 6px;
}

.target-chart-svg {
  display: block;
  width: 100%;
  height: 165px;
  overflow: visible;
}

.widget-todo-body {
  padding: 0;
}

.todo-input-row {
  display: flex;
  align-items: center;
  height: 32px;
  border-bottom: 1px solid var(--border-default);
  background-color: var(--bg-app);
}

.todo-plus {
  width: 32px;
  text-align: center;
  font-weight: 700;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-default);
  line-height: 32px;
}

.todo-quick-input {
  flex: 1 1 auto;
  height: 100%;
  padding: 0 9px;
  border: none;
  outline: none;
  background-color: transparent;
  font-size: 12px;
}

.todo-quick-input:focus {
  background-color: var(--bg-surface);
}

.todo-grid-list {
  max-height: 176px;
  overflow-y: auto;
}

.todo-row {
  display: grid;
  grid-template-columns: 32px 1fr 28px;
  align-items: center;
  min-height: 30px;
  border-bottom: 1px solid var(--border-default);
  background-color: var(--bg-surface);
}

.todo-row:last-child {
  border-bottom: none;
}

.todo-row:hover {
  background-color: var(--bg-active-row);
}

.todo-check-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-right: 1px solid var(--border-default);
}

.todo-check-btn {
  width: 15px;
  height: 15px;
  padding: 0;
  border: 1px solid var(--text-secondary);
  background-color: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 13px;
  text-align: center;
}

.todo-row.is-completed .todo-check-btn {
  background-color: var(--text-muted);
  border-color: var(--text-muted);
  color: var(--text-inverse);
}

.todo-task-cell {
  padding: 5px 8px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: text;
  word-break: break-word;
}

.todo-row.is-completed .todo-task-cell {
  color: var(--text-muted);
  text-decoration: line-through;
}

.todo-inline-input {
  width: 100%;
  height: 24px;
  padding: 0 5px;
  border: 1px solid var(--border-strong);
  outline: none;
  background-color: var(--bg-surface);
  font-size: 12px;
}

.todo-del-btn {
  width: 100%;
  height: 100%;
  border: none;
  border-left: 1px solid var(--border-default);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.todo-del-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-header);
}

.todo-empty-row {
  padding: 14px 10px;
  text-align: center;
  font-size: 12px;
}

.heatmap-scale {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.scale-label {
  font-size: 10px;
  color: var(--text-muted);
  margin: 0 2px;
}

.hm-lv {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.hm-lv-0 { background-color: var(--hm-lv-0); }
.hm-lv-1 { background-color: var(--hm-lv-1); }
.hm-lv-2 { background-color: var(--hm-lv-2); }
.hm-lv-3 { background-color: var(--hm-lv-3); }
.hm-lv-4 { background-color: var(--hm-lv-4); }

.heatmap-scroll-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.heatmap-board {
  display: inline-flex;
  align-items: flex-start;
  gap: 5px;
}

.heatmap-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  gap: 2px;
  padding-top: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 10px;
  color: var(--text-muted);
}

.heatmap-months-and-cells {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-months-row {
  position: relative;
  height: 13px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-secondary);
}

.heatmap-month-label {
  position: absolute;
  top: 0;
  white-space: nowrap;
}

.heatmap-weeks-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 10px);
  gap: 2px;
}

.heatmap-cell {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.heatmap-cell:hover {
  border-color: var(--border-strong);
}

.heatmap-cell.is-pad {
  visibility: hidden;
}

.widget-golden-body {
  padding: 0;
}

.golden-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.golden-col {
  padding: 8px 10px;
  min-width: 0;
}

.golden-col:first-child {
  border-right: 1px solid var(--border-default);
}

.golden-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-default);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.golden-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 205px;
  overflow-y: auto;
}

.golden-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.golden-row-label {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}

.golden-row.is-golden .golden-row-label {
  color: var(--text-primary);
  font-weight: 700;
}

.golden-bar-track {
  height: 8px;
  background-color: var(--bg-header);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

.golden-bar-fill {
  height: 100%;
  background-color: #888888;
}

.golden-row.is-golden .golden-bar-fill {
  background-color: var(--text-primary);
}

.golden-row-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
}

.golden-badge {
  display: inline-block;
  margin-left: 3px;
  padding: 0 4px;
  background-color: var(--text-primary);
  color: var(--text-inverse);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

/* ==========================================================================
   4B. Are.na Block Board Workspace
   ========================================================================== */
.workspace-arena {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - var(--top-stack-height));
  background-color: var(--bg-app);
  overflow: hidden;
}

.arena-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 42px;
  min-height: 42px;
  padding: 0 16px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
}

.arena-filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.arena-filter-tab {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  background-color: var(--bg-app);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.arena-filter-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.arena-filter-tab.is-active {
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
  font-weight: 600;
}

.arena-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.arena-count-label {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.arena-search-input {
  width: 240px;
  height: 28px;
  padding: 0 10px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-default);
  font-size: 12px;
  outline: none;
}

.arena-search-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--border-strong);
}

.arena-board-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px;
}

.arena-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.arena-card {
  display: flex;
  flex-direction: column;
  min-height: 270px;
  padding: 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  transition: border-color 0.08s linear;
}

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

/* First Slot: Dashed Composer Card */
.arena-card-composer {
  background-color: var(--bg-app);
  border: 1px dashed var(--border-dashed);
}

.arena-card-composer:hover,
.arena-card-composer:focus-within {
  background-color: var(--bg-surface);
  border-color: var(--border-strong);
}

.composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.composer-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.composer-select {
  height: 24px;
  font-family: var(--font-sans);
  font-size: 11.5px;
}

.composer-title-input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
}

.composer-title-input:focus {
  border-color: var(--border-strong);
}

.composer-content-input {
  flex: 1 1 auto;
  width: 100%;
  min-height: 120px;
  padding: 8px;
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  font-size: 12.5px;
  line-height: 1.55;
  resize: none;
  outline: none;
}

.composer-content-input:focus {
  border-color: var(--border-strong);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
}

/* Rendered Are.na Block Item Cards */
.arena-card-item {
  cursor: pointer;
}

.arena-card-item.is-inline-editing {
  cursor: default;
  border: 2px solid var(--border-strong);
  padding: 13px;
}

.block-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-default);
}

.block-cat-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  background-color: var(--bg-header);
  border: 1px solid var(--border-default);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.block-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.block-date-text {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  color: var(--text-muted);
}

.block-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.block-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.block-inline-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background-color: var(--bg-header);
}

.block-card-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.block-card-body {
  flex: 1 1 auto;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
}

.block-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.arena-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 270px;
  padding: 20px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  text-align: center;
  font-size: 12px;
}

/* ==========================================================================
   Modals, Floating Tooltip & Toast (Zero Shadow, 1px Crisp Borders)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: rgba(17, 17, 17, 0.45);
}

.modal-panel {
  width: 100%;
  max-width: 460px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
}

.modal-panel-wide {
  max-width: 580px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 14px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-default);
}

.modal-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.btn-icon-close {
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  color: var(--text-secondary);
}

.btn-icon-close:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background-color: var(--bg-surface);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 7px 9px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
}

.form-input {
  height: 32px;
}

.form-textarea {
  line-height: 1.55;
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--border-strong);
}

.form-input[readonly] {
  background-color: var(--bg-header);
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border-default);
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.mono-tooltip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  padding: 6px 9px;
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border: 1px solid var(--text-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-line;
}

.mono-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 210;
  padding: 8px 14px;
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border: 1px solid var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1200px) {
  .sheet-key-hint {
    display: none;
  }

  .panel-sheet {
    width: 58%;
  }

  .panel-widgets {
    width: 42%;
    min-width: 300px;
  }
}

@media (max-width: 980px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .gnb-bar,
  .subbar {
    height: auto;
    min-height: 44px;
    padding: 8px 12px;
    flex-wrap: wrap;
  }

  .workspace-split {
    flex-direction: column;
    height: auto;
  }

  .panel-sheet,
  .panel-widgets {
    width: 100%;
    min-width: 0;
    height: auto;
  }

  .panel-sheet {
    border-right: none;
    border-bottom: 1px solid var(--border-default);
    min-height: 420px;
  }
}
