:root {
  --bg: #0b0e13;
  --panel: #151a22;
  --surface: #1b222d;
  --surface-raised: #222a36;
  --card: #202733;
  --text: #f4f7fb;
  --muted: #96a0ae;
  --line: #303846;
  --line-strong: #4a5566;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --radius: 10px;
  --focus: #7cc4ff;
  --button: #dfe8f6;
  --button-hover: #c8d7ed;
  --button-text: #0d1117;
  --accent: #6ea8fe;
  --do: #ff6b6b;
  --schedule: #6ea8fe;
  --delegate: #f2ad52;
  --drop: #98a2b3;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: normal;
  overflow-x: hidden;
  hyphens: none;
  scrollbar-color: #505a68 #10141b;
}

body {
  margin: 0;
  background: var(--bg);
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #10141b;
}

::-webkit-scrollbar-thumb {
  border: 3px solid #10141b;
  border-radius: 999px;
  background: #505a68;
}

::-webkit-scrollbar-thumb:hover {
  background: #667181;
}

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

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
}

button {
  min-height: 38px;
  padding: 0 14px;
  background: var(--button);
  color: var(--button-text);
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--button-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

input,
select,
textarea {
  min-width: 0;
  min-height: 38px;
  padding: 0 11px;
  background: #0f141b;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(124, 196, 255, 0.26);
  outline-offset: 2px;
}

.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;
}

.primary-button {
  background: var(--accent);
  color: #06121f;
  font-weight: 750;
  border-color: transparent;
}

.primary-button:hover {
  background: #8bbcff;
}

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

.ghost-button:hover {
  background: #1b2430;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: var(--line);
  background: #111720;
  color: var(--text);
}

.icon-button:hover {
  background: #1b2430;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

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

.auth-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(360px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-brand {
  justify-content: center;
}

.auth-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.auth-login-button {
  width: 100%;
}

.auth-pending .app-shell,
.auth-blocked .app-shell {
  visibility: hidden;
  pointer-events: none;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 20px 20px 96px;
}

/* ── Topbar ───────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  margin: -20px -20px 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(48, 56, 70, 0.72);
  background: rgba(11, 14, 19, 0.86);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  background: #121721;
  border-radius: 5px;
}

.brand-mark span {
  border-radius: 2px;
}

.brand-mark span:nth-child(1) { background: var(--do); }
.brand-mark span:nth-child(2) { background: var(--schedule); }
.brand-mark span:nth-child(3) { background: var(--delegate); }
.brand-mark span:nth-child(4) { background: var(--drop); }

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

.brand-copy p {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.brand-copy h1 {
  overflow: hidden;
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.15rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 0.62em;
  font-weight: 800;
  line-height: 1;
  vertical-align: 0.15em;
  white-space: nowrap;
}

/* ── View switch ──────────────────────────────────── */
.view-switch {
  display: inline-grid;
  grid-template-columns: repeat(7, minmax(52px, auto));
  flex: 0 0 auto;
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #111720;
}

.view-button {
  min-height: 28px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.view-button:hover {
  background: #1b2430;
  color: var(--text);
}

.view-button.is-active {
  background: var(--button);
  color: var(--button-text);
}

.top-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

/* ── 설정 메뉴 (계정 · 가져오기 · 로그아웃) ─────────── */
.settings-menu {
  flex: 0 0 auto;
}

.settings-trigger {
  font-size: 1rem;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.settings-trigger::-webkit-details-marker {
  display: none;
}

.settings-popover {
  right: 0;
  min-width: 200px;
  gap: 6px;
}

.settings-account {
  display: grid;
  gap: 3px;
  padding: 2px 8px 8px;
  border-bottom: 1px solid var(--line);
}

.settings-account[hidden] {
  display: none;
}

.settings-account-caption {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auth-user {
  max-width: 220px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.settings-item:hover {
  background: #232c39;
}

.settings-logout {
  color: #f1a5a5;
}

.settings-logout:hover {
  background: rgba(241, 90, 90, 0.14);
}

/* ── 동기화 상태 표시줄 ───────────────────────────── */
.sync-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.sync-status:empty {
  display: none;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.sync-pill:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.sync-synced .sync-dot {
  background: #22c55e;
}

.sync-saving .sync-dot,
.sync-loading .sync-dot {
  background: #eab308;
  animation: sync-pulse 1s ease-in-out infinite;
}

.sync-offline .sync-dot {
  background: #f97316;
}

.sync-local .sync-dot {
  background: var(--line-strong);
}

@keyframes sync-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── Category(project) filter ─────────────────────── */
.category-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #121823;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.filter-chip:hover {
  background: #1a2230;
  color: var(--text);
}

.filter-chip.is-active {
  border-color: var(--category-color, var(--accent));
  background: color-mix(in srgb, var(--category-color, var(--accent)) 18%, #121823);
  color: var(--text);
}

.filter-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--category-color, var(--accent));
  flex: 0 0 auto;
}

.filter-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  text-align: center;
}

.filter-clear {
  color: var(--muted);
}

.composer-slot {
  flex: 0 0 auto;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.composer-form input[name="taskTitle"] {
  min-width: 180px;
}

.data-import-layer:empty {
  display: none;
}

.usage-layer:empty {
  display: none;
}

.member-layer:empty {
  display: none;
}

.member-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: rgba(0, 0, 0, 0.68);
}

.member-panel {
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.member-panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(14px);
}

.member-panel-header p,
.member-section-kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.member-panel-header h2,
.profile-editor h3,
.member-access h3 {
  margin: 0;
}

.member-panel-header h2 {
  font-size: 1.25rem;
}

.member-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.profile-editor,
.member-access {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding: 24px;
}

.profile-editor {
  border-right: 1px solid var(--line);
}

.profile-editor > div:first-child > p:last-child,
.member-access > div:first-child > p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-preview {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(135deg, #31405a, #1b2534);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 850;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-actions {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex-direction: column;
}

.profile-upload-button {
  cursor: pointer;
}

.profile-avatar-actions small,
.profile-email {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-name-field,
.member-invite-form {
  display: grid;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 750;
}

.profile-save-button {
  justify-self: start;
}

.member-capacity {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.member-capacity strong {
  font-size: 1.05rem;
}

.member-capacity span {
  color: var(--muted);
  font-size: 0.8rem;
}

.member-slot-list {
  display: grid;
  gap: 8px;
}

.member-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}

.member-slot > span:last-child {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.member-slot > span:last-child strong {
  font-size: 0.76rem;
}

.member-slot > span:last-child small {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-slot.is-empty {
  grid-template-columns: auto 1fr;
  color: var(--muted);
  border-style: dashed;
  background: transparent;
}

.member-slot.is-empty > span:last-child {
  justify-items: start;
}

.member-empty-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  font-size: 1rem;
}

.member-invite-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.text-button,
.text-danger-button {
  width: fit-content;
  min-height: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  cursor: pointer;
}

.text-danger-button {
  color: #ff7b85;
}

.member-local-note,
.member-readonly-note,
.member-panel-error,
.member-loading {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
  line-height: 1.55;
}

.member-local-note {
  border: 1px solid #f59e0b44;
  color: #e7c889;
  background: #f59e0b0c;
}

.member-panel-error {
  margin: 0 24px 24px;
  border: 1px solid #ff6b7544;
  color: #ff9aa1;
  background: #ff6b750c;
}

.usage-panel {
  width: min(760px, 100%);
}

.usage-panel-body {
  display: grid;
  gap: 20px;
  padding: 24px;
}

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

.usage-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}

.usage-card-heading,
.usage-limit-heading,
.usage-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-card-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.usage-card-heading span,
.usage-limit-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.usage-card-heading strong {
  font-size: 0.98rem;
}

.usage-card small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.usage-meter {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
}

.usage-meter span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
}

.usage-section {
  display: grid;
  gap: 12px;
}

.usage-section-heading p {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.usage-section-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.usage-limit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
}

.usage-limit-row {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.usage-limit-heading strong {
  font-size: 0.78rem;
}

.usage-panel-note,
.usage-loading,
.usage-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
  line-height: 1.55;
}

.usage-loading {
  text-align: center;
}

.usage-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #ff6b7544;
  color: #ff9aa1;
  background: #ff6b750c;
}

.usage-error p {
  margin: 0;
}

.data-import-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
}

.data-import-panel {
  display: grid;
  gap: 12px;
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.data-import-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-import-header h2 {
  margin: 0;
  font-size: 1rem;
}

.import-textarea {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  line-height: 1.5;
  white-space: pre-wrap;
}

.import-error {
  margin: 0;
  color: var(--do);
  font-size: 0.86rem;
}

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

/* ── Workspace / views ────────────────────────────── */
.workspace {
  display: block;
  min-width: 0;
}

.view {
  display: none;
  min-width: 0;
}

.workspace[data-mode="board"] .board-view {
  display: grid;
  gap: 16px;
}

.workspace[data-mode="kanban"] .kanban-view {
  display: block;
}

.workspace[data-mode="matrix"] .matrix-view {
  display: block;
}

.workspace[data-mode="schedule"] .schedule-view {
  display: block;
}

.workspace[data-mode="memo"] .memo-view {
  display: block;
}

.workspace[data-mode="files"] .files-view {
  display: block;
}

.workspace[data-mode="done"] .done-view {
  display: block;
}

.muted-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ── Inbox (board) ────────────────────────────────── */
.inbox {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.inbox-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.inbox.is-collapsed .inbox-header {
  border-bottom: 0;
}

.inbox-header h2 {
  margin: 0;
  font-size: 1rem;
}

.inbox-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.inbox-toggle:hover {
  background: transparent;
}

.inbox-caret {
  color: var(--muted);
  transition: transform 140ms ease;
}

.inbox.is-collapsed .inbox-caret {
  transform: rotate(-90deg);
}

.inbox-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.inbox-board {
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  min-height: 92px;
  padding: 12px;
}

.inbox.is-collapsed .inbox-board {
  display: none;
}

.inbox-board .empty-state {
  width: 100%;
}

.inbox-card {
  flex: 0 0 240px;
}

/* ── Swimlane grid (board) ────────────────────────── */
.swimlane {
  min-width: 0;
}

.swimlane-grid {
  display: grid;
  grid-template-columns: 148px repeat(4, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.grid-head-row,
.grid-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  gap: 1px;
}

.grid-corner,
.grid-col-head {
  padding: 11px 14px;
  background: #111722;
}

.grid-col-head {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.grid-row-head {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 14px;
  border-left: 4px solid var(--quadrant-color, var(--line-strong));
  background: #141a23;
}

.row-meta {
  color: var(--quadrant-color, var(--muted));
  font-size: 0.74rem;
  font-weight: 800;
}

.row-title {
  font-size: 0.98rem;
  font-weight: 800;
}

.row-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.grid-cell {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 116px;
  padding: 10px;
  background: #10151d;
}

.grid-cell.is-done-col {
  background: #0c1118;
}

/* ── Kanban view ──────────────────────────────────── */
.kanban-board {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  min-height: calc(100vh - 150px);
  padding-bottom: 14px;
  cursor: grab;
}

.kanban-board.is-panning {
  cursor: grabbing;
  user-select: none;
}

.kanban-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  flex: 0 0 250px;
  max-height: calc(100vh - 160px);
  padding: 10px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--category-color, var(--line-strong));
  border-radius: var(--radius);
  background: #141a23;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 2px 8px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
}

.kanban-column-header:active {
  cursor: grabbing;
}

.kanban-column-header .category-edit-input,
.kanban-column-header .kanban-menu {
  cursor: auto;
}

.kanban-column.is-dragging-col {
  opacity: 0.4;
}

/* 열을 드롭할 위치 표시줄 */
.kanban-column.drop-before,
.kanban-column.drop-after {
  position: relative;
}

.kanban-column.drop-before::before,
.kanban-column.drop-after::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--category-color, var(--accent));
}

.kanban-column.drop-before::before {
  left: -8px;
}

.kanban-column.drop-after::after {
  right: -8px;
}

.kanban-column-name-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.kanban-column-name {
  display: block;
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-column-header .category-edit-input {
  width: 100%;
  font-weight: 750;
}

.kanban-menu {
  flex: 0 0 auto;
}

.kanban-menu > summary {
  list-style: none;
}

.kanban-menu > summary::-webkit-details-marker {
  display: none;
}

.kanban-menu .lane-menu-popover {
  right: 0;
  width: 248px;
}

.kanban-menu .lane-menu-popover > button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

/* 리스트 추가 칼럼 */
.kanban-add-list-col {
  flex: 0 0 230px;
}

.kanban-add-list {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.kanban-add-list:hover {
  background: rgba(124, 196, 255, 0.1);
  color: var(--text);
}

.kanban-add-list-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141a23;
}

.kanban-lanes {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px;
}

.kanban-lane {
  display: grid;
  gap: 6px;
}

/* 아주 옅은 구분선: 가는 선 사이에 작은 라벨 */
.kanban-lane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.kanban-lane-head::before,
.kanban-lane-head::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.kanban-lane-head::before {
  width: 10px;
  flex: 0 0 auto;
}

.kanban-lane-head::after {
  flex: 1 1 auto;
}

.kanban-lane-title {
  flex: 0 0 auto;
}

.kanban-lane-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 600;
}

.kanban-stack {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 14px;
  padding: 2px;
  border-radius: 8px;
}

/* 칸반 카드는 더 촘촘하게: 여백·글자 축소 */
.kanban-card {
  padding: 6px 10px;
}

.kanban-card .task-title {
  font-size: 0.82rem;
  -webkit-line-clamp: 2;
}

/* 드래그 중 마우스를 올린 단계만 실시간으로 넓어져 떨어뜨리기 쉽게 (다른 칸은 그대로) */
.kanban-stack.is-over {
  min-height: 40px;
}

.kanban-add {
  justify-self: start;
  min-height: 32px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.kanban-add:hover {
  background: rgba(124, 196, 255, 0.12);
  color: var(--text);
}

.kanban-form {
  display: grid;
  gap: 8px;
}

.kanban-form-actions {
  display: flex;
  gap: 6px;
}

.kanban-form-actions button {
  min-height: 34px;
  padding: 0 12px;
}

/* ── Matrix view (2×2) ────────────────────────────── */
.matrix-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
  /* 화면 높이에 맞춰 고정 → 각 분면이 내부에서 스크롤 */
  height: calc(100vh - 140px);
  min-height: 420px;
}

.matrix-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.quadrant-cell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--quadrant-color, var(--line-strong));
  border-radius: var(--radius);
  background: #141a23;
}

.quadrant-cell-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.quadrant-kicker,
.quadrant-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.quadrant-kicker,
.quadrant-title,
.quadrant-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quadrant-title {
  margin-top: 2px;
  font-size: 1.02rem;
  font-weight: 800;
}

.quadrant-stack {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(74, 85, 102, 0.5);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.5);
}

.matrix-backlog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
}

.matrix-backlog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.matrix-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.matrix-backlog-header h2 {
  margin: 0;
  font-size: 1rem;
}

.matrix-backlog-stack {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.6);
}

/* ── Drop zone states ─────────────────────────────── */
.drop-zone.is-over {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  background: rgba(124, 196, 255, 0.1);
}

body.is-dragging-task .grid-cell,
body.is-dragging-task .inbox-board,
body.is-dragging-task .quadrant-stack,
body.is-dragging-task .matrix-backlog-stack {
  background: rgba(124, 196, 255, 0.05);
}

/* ── Task card ────────────────────────────────────── */
.task-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--category-color);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    outline-color 120ms ease;
}

.task-card:hover {
  background: #252e3a;
}

/* 드래그 중인 원본은 숨기고, 들어갈 자리에는 placeholder 빈 칸만 표시 */
.task-card.is-dragging {
  display: none;
}

.card-placeholder {
  min-height: 34px;
  border: 1px dashed var(--focus);
  border-radius: 8px;
  background: rgba(124, 196, 255, 0.12);
}

.task-card[draggable="true"] {
  cursor: grab;
}

/* 완료 카드: 비활성처럼 흐릿하게 (칸반·사분면·통합 공통) */
.task-card.is-done {
  opacity: 0.5;
  border-color: var(--line);
  border-left-color: var(--line-strong);
  background: #11151c;
  box-shadow: none;
  filter: saturate(0.5);
}

.task-card.is-done:hover {
  opacity: 0.72;
  background: #161b23;
}

.task-card.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.task-card.is-done .task-pill {
  opacity: 0.7;
}

.task-title {
  display: -webkit-box;
  overflow: hidden;
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.task-edit-input {
  font-size: 0.9rem;
}

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

.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 132px;
  padding: 2px 7px 2px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 80%, transparent);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.author-badge img,
.author-initial {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.author-badge img {
  object-fit: cover;
}

.author-initial {
  background: var(--author-tone, #526d98);
  color: #fff;
  font-size: 0.62rem;
}

.author-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-badge.is-legacy {
  padding: 4px 7px;
  border-style: dashed;
  color: #7f8998;
  font-weight: 600;
}

/* 사분면·통합 카드: 카테고리를 줄바꿈 없이 제목 오른쪽에 배치해 높이 절약 */
.matrix-card,
.cell-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.matrix-card .task-title,
.cell-card .task-title {
  flex: 1 1 auto;
  min-width: 0;
  -webkit-line-clamp: 2;
}

.matrix-card .task-meta,
.cell-card .task-meta {
  flex: 0 0 auto;
  max-width: 45%;
}

.task-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  overflow: hidden;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-pill-category {
  background: color-mix(in srgb, var(--pill-color) 22%, transparent);
  color: var(--text);
}

.task-pill-priority {
  border: 1px solid color-mix(in srgb, var(--pill-color) 55%, transparent);
  color: var(--text);
}

.task-pill-priority::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pill-color);
}

.task-pill-status {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

/* ── Inline edit ──────────────────────────────────── */
.inline-edit-input {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
}

.inline-edit-input:focus {
  outline: 0;
}

.task-edit-input {
  font-size: 0.9rem;
}

.category-name {
  overflow: hidden;
  cursor: text;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* ── Menus / popovers ─────────────────────────────── */
.lane-menu {
  position: relative;
}

.lane-menu-popover {
  position: absolute;
  z-index: 30;
  margin-top: 6px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1b222d;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.lane-menu:not([open]) .lane-menu-popover {
  display: none;
}

.category-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* ── Color palette ────────────────────────────────── */
.category-color-palette {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.color-swatch-button,
.custom-color-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid rgba(244, 247, 251, 0.18);
  border-radius: 6px;
  background: var(--swatch-color);
  cursor: pointer;
}

.color-swatch-button:hover,
.custom-color-trigger:hover {
  border-color: rgba(244, 247, 251, 0.52);
}

.color-swatch-button.is-active {
  border-color: var(--focus);
  outline: 2px solid rgba(124, 196, 255, 0.34);
  outline-offset: 1px;
}

.custom-color-trigger {
  overflow: hidden;
  background:
    linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.84) 49%, rgba(255, 255, 255, 0.84) 51%, transparent 52%),
    var(--swatch-color);
}

.custom-color-preview {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--swatch-color);
}

.category-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── Empty state ──────────────────────────────────── */
.empty-state {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 10px;
  border: 1px dashed rgba(74, 85, 102, 0.5);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.grid-cell .empty-state {
  border: 0;
  min-height: 0;
}

/* ── Context menu (card right-click) ──────────────── */
.context-menu-layer:empty {
  display: none;
}

.context-menu {
  position: fixed;
  z-index: 60;
  min-width: 184px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1b222d;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.context-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
}

.context-menu button:hover {
  background: rgba(124, 196, 255, 0.14);
}

.context-sep {
  height: 1px;
  margin: 5px 6px;
  background: var(--line);
}

.context-danger {
  color: #ff8a8a;
}

.context-danger:hover {
  background: rgba(255, 107, 107, 0.16) !important;
}

.context-sub {
  position: relative;
}

.context-sub-trigger {
  justify-content: space-between;
}

.context-caret {
  color: var(--muted);
  font-size: 0.72rem;
}

.context-sub-panel {
  position: absolute;
  top: -6px;
  left: 100%;
  display: none;
  min-width: 168px;
  max-height: 280px;
  overflow-y: auto;
  margin-left: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1b222d;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.context-sub:hover > .context-sub-panel {
  display: block;
}

.context-menu.flip-left .context-sub-panel {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 0;
}

.context-check {
  display: inline-grid;
  place-items: center;
  width: 14px;
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.78rem;
}

.context-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

/* ── Done view ────────────────────────────────────── */
.danger-button {
  border-color: transparent;
  background: #d8453f;
  color: #fff;
  font-weight: 750;
}

.danger-button:hover {
  background: #e35a55;
}

.done-page {
  display: grid;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.done-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.done-header-text h2 {
  margin: 0;
  font-size: 1.2rem;
}

.done-header-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.done-header-text strong {
  color: var(--text);
}

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

.done-bucket {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.done-bucket[data-bucket="today"] {
  border-color: color-mix(in srgb, var(--accent, #3b82f6) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #3b82f6) 18%, transparent) inset;
}

.done-bucket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.done-bucket-title h3 {
  margin: 0;
  font-size: 1.05rem;
}

.done-bucket-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.done-settle {
  white-space: nowrap;
  font-weight: 750;
}

.done-list {
  display: grid;
  gap: 16px;
}

.done-group {
  display: grid;
  gap: 10px;
}

.done-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.done-group-name {
  font-weight: 750;
}

.done-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.done-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--category-color, var(--line-strong));
  border-radius: 8px;
  background: var(--card);
}

.done-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

.done-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.done-card-actions .ghost-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.done-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.done-empty-emoji {
  font-size: 2.4rem;
}

/* ── 일정 맞추기 ─────────────────────────────────── */
.schedule-page {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
}

.schedule-page-header,
.schedule-card-header,
.schedule-selection-intro,
.schedule-selected-heading,
.schedule-selection-actions,
.schedule-results-heading,
.schedule-confirmed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.schedule-page-header h2,
.schedule-page-header p,
.schedule-card-header h3,
.schedule-card-header p,
.schedule-results-heading h4,
.schedule-results-heading span,
.schedule-selection-intro p,
.schedule-selection-intro span,
.schedule-selected-heading span,
.schedule-empty h3,
.schedule-empty p {
  margin: 0;
}

.schedule-page-header h2 {
  font-size: 1.2rem;
}

.schedule-page-header p,
.schedule-card-note,
.schedule-selection-intro p,
.schedule-selection-intro span,
.schedule-selected-heading span,
.schedule-results-heading span,
.schedule-empty p {
  color: var(--muted);
  font-size: 0.85rem;
}

.schedule-create-form,
.schedule-poll-list,
.schedule-card,
.schedule-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.schedule-create-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.schedule-form-title {
  display: grid;
  gap: 12px;
}

.schedule-form-title {
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
}

.schedule-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.schedule-create-submit {
  min-width: 112px;
}

.schedule-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-form-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.schedule-form-error {
  margin: 0;
  color: var(--do);
  font-size: 0.84rem;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.schedule-poll-list {
  display: grid;
  gap: 6px;
  padding: 8px;
  position: sticky;
  top: 12px;
}

.schedule-poll-item {
  display: grid;
  justify-items: start;
  gap: 5px;
  width: 100%;
  min-height: 0;
  padding: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.schedule-poll-item:hover,
.schedule-poll-item.is-active {
  border-color: var(--line-strong);
  background: var(--surface);
}

.schedule-poll-item.is-active {
  box-shadow: inset 3px 0 var(--accent);
}

.schedule-poll-item strong {
  font-size: 0.9rem;
}

.schedule-poll-item span,
.schedule-card-kicker {
  color: var(--muted);
  font-size: 0.75rem;
}

.schedule-poll-item small {
  color: #dbeafe;
  font-size: 0.72rem;
  font-weight: 750;
}

.schedule-card {
  min-width: 0;
  overflow: hidden;
}

.schedule-card-header {
  align-items: flex-start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.schedule-card-header h3 {
  font-size: 1.12rem;
}

.schedule-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.schedule-card-kicker {
  margin: 0 !important;
}

.schedule-card-note {
  margin-top: 7px !important;
}

.schedule-collaborators {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin: 10px 0 0;
}

.schedule-collaborators span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.schedule-collaborators strong {
  color: #dbeafe;
  font-size: 0.76rem;
}

.schedule-delete {
  flex: 0 0 auto;
}

.schedule-confirmed-banner {
  justify-content: flex-start;
  padding: 11px 18px;
  border-bottom: 1px solid #10b98155;
  background: #10b98112;
}

.schedule-confirmed-banner > span:nth-child(2) {
  display: grid;
  flex: 1;
  gap: 2px;
}

.schedule-confirmed-banner small {
  color: #6ee7b7;
  font-size: 0.68rem;
  font-weight: 800;
}

.schedule-confirmed-banner strong {
  font-size: 0.9rem;
}

.schedule-confirmed-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10b98124;
  color: #6ee7b7;
  font-size: 0.82rem;
  font-weight: 900;
}

.schedule-confirmed-banner button,
.schedule-selection-actions .ghost-button {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
}

.schedule-response-flow {
  display: grid;
  grid-template-columns: auto minmax(32px, 1fr) auto minmax(32px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f141b;
}

.schedule-response-flow > span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.schedule-response-flow > i {
  height: 1px;
  background: var(--line);
}

.schedule-response-flow b,
.schedule-section-title > span:first-child,
.schedule-save-copy > span:first-child {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.schedule-response-flow > span > span,
.schedule-section-title > span:last-child,
.schedule-save-copy > span:last-child {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.schedule-response-flow strong {
  color: var(--text);
  font-size: 0.77rem;
}

.schedule-response-flow small {
  color: var(--muted);
  font-size: 0.66rem;
}

.schedule-response-flow .is-done b {
  border-color: #60a5fa66;
  background: #2563eb24;
  color: #bfdbfe;
}

.schedule-response-flow .is-active b {
  border-color: #f59e0b88;
  background: #f59e0b1f;
  color: #fde68a;
  box-shadow: 0 0 0 3px #f59e0b12;
}

.schedule-selection-panel {
  display: grid;
  grid-template-areas:
    "intro intro"
    "modes dates";
  grid-template-columns: minmax(460px, 1.1fr) minmax(340px, 0.9fr);
  gap: 12px;
  margin: 10px 18px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #11161d;
}

.schedule-selection-panel.is-pending {
  border-color: #f59e0b55;
}

.schedule-selection-intro {
  grid-area: intro;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.schedule-selection-intro > span:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.schedule-selection-intro > span:first-child small {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
}

.schedule-selection-intro > span:first-child strong {
  color: var(--text);
  font-size: 0.88rem;
}

.schedule-response-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: none !important;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem !important;
  font-weight: 800;
  text-align: left !important;
  white-space: nowrap;
}

.schedule-response-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.schedule-response-status.is-saved {
  border-color: #10b98155;
  background: #10b98112;
  color: #6ee7b7;
}

.schedule-response-status.is-pending {
  border-color: #f59e0b55;
  background: #f59e0b12;
  color: #fde68a;
}

.schedule-mode-step {
  grid-area: modes;
  display: grid;
  align-content: start;
  gap: 10px;
}

.schedule-section-title {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.schedule-section-title strong,
.schedule-save-copy strong {
  color: var(--text);
  font-size: 0.82rem;
}

.schedule-section-title small,
.schedule-save-copy small {
  color: var(--muted);
  font-size: 0.7rem;
}

.schedule-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.schedule-mode-switch button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 0;
  padding: 12px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.schedule-mode-switch button:hover {
  border-color: var(--line-strong);
}

.schedule-mode-switch button.is-active {
  border-color: #6ea8feaa;
  background: #2563eb18;
  box-shadow: inset 0 0 0 1px #6ea8fe44;
}

.schedule-mode-switch button[data-mode="exclude"].is-active {
  border-color: #fb7185aa;
  background: #e11d4818;
  box-shadow: inset 0 0 0 1px #fb718544;
}

.schedule-mode-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff0a;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.schedule-mode-switch button.is-active .schedule-mode-icon {
  background: #2563eb2e;
  color: #bfdbfe;
}

.schedule-mode-switch button[data-mode="exclude"].is-active .schedule-mode-icon {
  background: #e11d4833;
  color: #fecdd3;
}

.schedule-mode-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.schedule-mode-copy strong {
  font-size: 0.82rem;
}

.schedule-mode-copy small {
  color: var(--muted);
  font-size: 0.67rem;
}

.schedule-mode-state {
  align-self: start;
  padding: 3px 6px;
  border-radius: 999px;
  background: #ffffff0a;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.schedule-mode-switch button.is-active .schedule-mode-state {
  background: #2563eb26;
  color: #bfdbfe;
}

.schedule-mode-switch button[data-mode="exclude"].is-active .schedule-mode-state {
  background: #e11d4828;
  color: #fecdd3;
}

.schedule-selected-dates {
  grid-area: dates;
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.schedule-selected-heading > span:first-child {
  display: grid;
  gap: 1px;
}

.schedule-selected-heading small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.schedule-selected-heading strong {
  font-size: 0.82rem;
}

.schedule-date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 29px;
  max-height: 104px;
  overflow-y: auto;
}

.schedule-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border-color: #60a5fa66;
  background: #2563eb1d;
  color: #dbeafe;
  font-size: 0.71rem;
  white-space: nowrap;
}

.schedule-date-chip.is-exclude {
  border-color: #fb718566;
  background: #e11d481d;
  color: #ffe4e6;
}

.schedule-date-chip span {
  font-size: 0.9rem;
  line-height: 1;
}

.schedule-date-empty {
  align-self: center;
  color: var(--muted);
  font-size: 0.74rem;
}

.schedule-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 18px 10px;
}

.schedule-selection-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-selection-actions {
  position: sticky;
  top: 76px;
  z-index: 12;
  margin: 0 18px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 22, 29, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(12px);
}

.schedule-selection-actions.is-pending {
  border-color: #f59e0b66;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26), inset 3px 0 #f59e0b;
}

.schedule-selection-actions.is-saved {
  border-color: #10b98144;
}

.schedule-save-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.schedule-action-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.schedule-selection-confirm {
  min-width: 104px;
  min-height: 36px !important;
  border-color: transparent !important;
  background: var(--accent) !important;
  color: #06121f !important;
  font-size: 0.78rem !important;
  font-weight: 850;
}

.schedule-selection-actions.is-saved .schedule-selection-confirm:disabled {
  border-color: #10b98155 !important;
  background: #10b98116 !important;
  color: #6ee7b7 !important;
  opacity: 1;
}

.schedule-months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 15px;
  padding: 0 18px;
}

.schedule-month {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.schedule-month h4 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.88rem;
}

.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--line);
  user-select: none;
}

.schedule-calendar-weekday,
.schedule-calendar-pad,
.schedule-calendar-day {
  background: #141a22;
}

.schedule-calendar-weekday {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.schedule-calendar-weekday.is-sunday,
.schedule-calendar-day.is-sunday {
  color: #fca5a5;
}

.schedule-calendar-weekday.is-saturday,
.schedule-calendar-day.is-saturday {
  color: #93c5fd;
}

.schedule-calendar-pad {
  min-height: 72px;
  background: #11161d;
}

.schedule-calendar-day {
  display: grid;
  grid-template-rows: 16px 1fr 18px;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 7px 5px;
  border: 0;
  border-radius: 0;
  color: #cbd5e1;
  touch-action: none;
}

.schedule-calendar-day:hover {
  background: #263242;
}

.schedule-calendar-day.is-selected-include {
  background: #2563eb;
  color: #fff;
}

.schedule-calendar-day.is-selected-exclude {
  background: #be123c;
  color: #fff;
}

.schedule-calendar-day.is-default-available {
  background: #0f2f28;
  color: #d1fae5;
}

.schedule-calendar-day.is-best {
  box-shadow: inset 0 0 0 2px #34d399;
}

.schedule-calendar-label {
  min-height: 16px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.schedule-calendar-day.is-selected-include .schedule-calendar-label,
.schedule-calendar-day.is-selected-exclude .schedule-calendar-label,
.schedule-calendar-day.is-default-available .schedule-calendar-label {
  color: #dbeafe;
}

.schedule-calendar-day strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.schedule-calendar-day small {
  min-height: 18px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  font-weight: 850;
  white-space: nowrap;
}

.schedule-legend {
  display: flex;
  gap: 14px;
  padding: 9px 18px 14px;
  color: var(--muted);
  font-size: 0.72rem;
}

.schedule-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.schedule-legend i {
  width: 13px;
  height: 13px;
  border-radius: 3px;
}

.legend-mine { background: #2563eb; }
.legend-exclude { background: #be123c; }
.legend-default { background: #0f2f28; border: 1px solid #34d39988; }
.legend-best { border: 2px solid #34d399; }

.schedule-results {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

.schedule-results-heading h4 {
  font-size: 0.95rem;
}

.schedule-best-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.schedule-best-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 10px 12px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.schedule-best-item:hover,
.schedule-best-item.is-top,
.schedule-best-item.is-confirmed {
  border-color: #34d39988;
  background: #10b98112;
}

.schedule-best-rank {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b98122;
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 850;
}

.schedule-best-item > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.schedule-best-item strong {
  font-size: 0.82rem;
}

.schedule-best-item small,
.schedule-confirm-label,
.schedule-no-results {
  color: var(--muted);
  font-size: 0.72rem;
}

.schedule-best-names {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.schedule-best-names em {
  padding: 2px 6px;
  border: 1px solid #60a5fa44;
  border-radius: 999px;
  background: #2563eb14;
  color: #dbeafe;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.schedule-confirm-label {
  white-space: nowrap;
}

.schedule-no-results {
  margin: 8px 0;
}

.schedule-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 64px 20px;
  text-align: center;
}

.schedule-empty-icon {
  font-size: 2.4rem;
}

@media (max-width: 1120px) {
  .schedule-selection-panel {
    grid-template-areas:
      "intro"
      "modes"
      "dates";
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-months {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .schedule-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-poll-list {
    display: flex;
    position: static;
    overflow-x: auto;
  }

  .schedule-poll-item {
    flex: 0 0 min(76vw, 250px);
  }

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

  .schedule-best-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-response-flow small {
    display: none;
  }

  .schedule-selection-actions {
    position: static;
  }
}

@media (max-width: 560px) {
  .schedule-page-header,
  .schedule-card-header,
  .schedule-selection-intro,
  .schedule-results-heading {
    align-items: flex-start;
  }

  .schedule-page-header,
  .schedule-selection-intro,
  .schedule-results-heading {
    flex-direction: column;
  }

  .schedule-selection-intro span {
    max-width: none;
    text-align: left;
  }

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

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

  .schedule-create-submit {
    width: 100%;
  }

  .schedule-card-header,
  .schedule-results {
    padding-left: 13px;
    padding-right: 13px;
  }

  .schedule-selection-panel {
    margin-left: 13px;
    margin-right: 13px;
    padding: 11px;
  }

  .schedule-response-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-left: 13px;
    margin-right: 13px;
    padding: 10px;
  }

  .schedule-response-flow > i {
    display: none;
  }

  .schedule-response-flow > span {
    align-items: center;
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }

  .schedule-response-flow strong {
    font-size: 0.69rem;
  }

  .schedule-mode-switch {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-calendar-toolbar {
    align-items: flex-start;
    flex-direction: column;
    margin-left: 13px;
    margin-right: 13px;
  }

  .schedule-selection-actions {
    align-items: stretch;
    flex-direction: column;
    margin-left: 13px;
    margin-right: 13px;
  }

  .schedule-action-buttons {
    width: 100%;
    flex-wrap: wrap;
  }

  .schedule-action-buttons .ghost-button {
    flex: 1;
  }

  .schedule-selection-confirm {
    flex: 1;
  }

  .schedule-months {
    padding-left: 13px;
    padding-right: 13px;
  }

  .schedule-calendar-pad,
  .schedule-calendar-day {
    min-height: 64px;
  }

  .schedule-calendar-day {
    grid-template-rows: 13px 1fr 15px;
    padding: 5px 2px;
  }

  .schedule-calendar-label,
  .schedule-calendar-day small {
    font-size: 0.6rem;
  }

  .schedule-calendar-day strong {
    font-size: 0.95rem;
  }

  .schedule-confirmed-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

/* ── 메모 뷰 ──────────────────────────────────────── */
.memo-page {
  display: grid;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.memo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.memo-header-text h2 {
  margin: 0;
  font-size: 1.2rem;
}

.memo-header-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.memo-header-text strong {
  color: var(--text);
}

.memo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

.memo-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.memo-card:focus-within {
  border-color: var(--line-strong);
}

.memo-card.is-dragging {
  opacity: 0.4;
}

.memo-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.memo-card-owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.memo-drag-handle {
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.memo-drag-handle:hover {
  color: var(--text);
  background: var(--panel);
}

.memo-drag-handle:active {
  cursor: grabbing;
}

.memo-delete {
  opacity: 0.65;
}

.memo-delete:hover {
  opacity: 1;
}

.memo-text {
  width: 100%;
  min-height: 1.6em;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.memo-text:focus {
  outline: none;
}

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

/* 메모 드롭 위치 표시줄 */
.memo-card.drop-before::before,
.memo-card.drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.memo-card.drop-before::before {
  top: -7px;
}

.memo-card.drop-after::after {
  bottom: -7px;
}

.memo-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.memo-empty-emoji {
  font-size: 2.4rem;
}

/* ── 파일 보관함 ───────────────────────────────────────── */
.files-page {
  position: relative;
  display: grid;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

/* 파일을 끌어올 때 나타나는 드롭 안내 오버레이 */
.files-drop-overlay {
  display: none;
  position: absolute;
  inset: -8px;
  z-index: 5;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--accent, #6c8cff);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent, #6c8cff) 14%, transparent);
  pointer-events: none;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.files-page.is-drop-target .files-drop-overlay {
  display: flex;
}

.files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.files-header-text h2 {
  margin: 0;
  font-size: 1.2rem;
}

.files-header-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.files-header-text strong {
  color: var(--text);
}

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

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.file-icon {
  font-size: 1.3rem;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.file-meta {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: 4px;
}

.file-delete:hover {
  color: var(--danger, #e5484d);
}

.files-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.files-empty-emoji {
  font-size: 2.4rem;
}

@media (max-width: 560px) {
  .file-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "icon name actions"
      "icon author actions"
      "icon meta actions";
    row-gap: 2px;
  }
  .file-icon { grid-area: icon; }
  .file-name { grid-area: name; }
  .file-row > .author-badge { grid-area: author; justify-self: start; }
  .file-meta { grid-area: meta; }
  .file-actions { grid-area: actions; }
}

/* 폭죽/컨페티 캔버스 */
.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* 화면 흔들림 (피날레/연발) */
.app-shell.is-shaking {
  animation: celebrate-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes celebrate-shake {
  10%, 90% { transform: translate3d(calc(var(--shake-amp, 8px) * -0.3), 0, 0); }
  20%, 80% { transform: translate3d(calc(var(--shake-amp, 8px) * 0.5), 0, 0); }
  30%, 50%, 70% { transform: translate3d(calc(var(--shake-amp, 8px) * -1), 0, 0); }
  40%, 60% { transform: translate3d(var(--shake-amp, 8px), 0, 0); }
}

/* 화이트 플래시 (큰 개수 피날레) */
.celebrate-flash {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: #fff;
  animation: celebrate-flash 0.34s ease-out forwards;
}

@keyframes celebrate-flash {
  0% { opacity: var(--flash-alpha, 0.4); }
  100% { opacity: 0; }
}

/* 카운트업 토스트 */
.celebrate-toast {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translate(-50%, 0) scale(0.9);
  z-index: 10000;
  pointer-events: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  animation: celebrate-toast-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.celebrate-toast.tier-2 { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.celebrate-toast.tier-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.celebrate-toast-num {
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.celebrate-toast-label {
  font-size: 1rem;
  opacity: 0.92;
}

.celebrate-toast.is-leaving {
  animation: celebrate-toast-out 0.45s ease-in forwards;
}

@keyframes celebrate-toast-in {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.85); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes celebrate-toast-out {
  0% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -16px) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell.is-shaking { animation: none; }
  .celebrate-toast { animation-duration: 0.01ms; }
}

.celebrate-sound-toggle {
  font-size: 1.1rem;
  line-height: 1;
  padding: 8px 12px;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1000px) {
  .topbar {
    flex-wrap: wrap;
  }

  .view-switch {
    order: 3;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .top-tools {
    order: 2;
  }

  /* 좁은 화면에선 고정 높이/내부 스크롤 해제하고 페이지 흐름으로 */
  .matrix-layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }

  .matrix-2x2 {
    grid-template-rows: auto;
    height: auto;
  }

  .quadrant-cell {
    min-height: 240px;
  }

  .quadrant-stack,
  .matrix-backlog-stack {
    overflow-y: visible;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    margin: -20px -20px 14px;
  }

  .top-tools {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .category-filter {
    justify-content: flex-start;
    width: 100%;
  }

  /* 통합 보드 격자를 분면별 세로 스택으로 접기 */
  .swimlane-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .grid-head-row {
    display: none;
  }

  .grid-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--quadrant-color, var(--line-strong));
    border-radius: var(--radius);
    background: var(--line);
    overflow: hidden;
  }

  .grid-row-head {
    grid-template-columns: auto auto 1fr;
    align-items: baseline;
    gap: 8px;
    border-left: 0;
  }

  .grid-cell {
    min-height: 60px;
  }

  .grid-cell::before {
    content: attr(data-status-label);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
  }

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

@media (max-width: 520px) {
  .app-shell {
    padding: 12px 12px 150px;
  }

  .topbar {
    margin: -12px -12px 12px;
    padding: 12px;
  }

  .brand-copy h1 {
    font-size: 0.95rem;
  }

  .composer-form input[name="taskTitle"] {
    min-width: 0;
    flex: 1 1 100%;
  }

  .kanban-column {
    flex-basis: min(82vw, 300px);
  }
}


/* ── 타임어택 ─────────────────────────────────────── */

/* 툴바 토글 버튼 */
.ta-toggle-btn {
  min-height: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #f3b14d;
  cursor: pointer;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: transform 0.12s, box-shadow 0.18s, background 0.18s, color 0.18s;
}
.ta-toggle-btn:hover {
  background: #f59e0b18;
  border-color: #f59e0b55;
  transform: translateY(-1px);
}
.ta-toggle-btn.is-active {
  background: linear-gradient(135deg, #ff7a5c, #f5a623);
  border-color: transparent;
  color: #1a1205;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.4);
}

/* 카드 위 + 버튼 */
.task-card { position: relative; }
.ta-card-btn {
  min-height: 0;
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(20, 26, 34, 0.78);
  backdrop-filter: blur(3px);
  color: #cdd6e2;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s, background 0.15s, color 0.15s;
}
.ta-card-btn:hover {
  background: #f59e0b;
  color: #1a1205;
  transform: scale(1.12);
}
.ta-card-btn.in-queue {
  background: #2bb673;
  color: #fff;
}
.ta-card-btn.in-queue:hover { background: #e5484d; }
.task-card.ta-queued {
  box-shadow: 0 0 0 1.5px #2bb67388, var(--shadow);
}
/* 패널 열렸을 때 카드 제목이 버튼 아래로 가려지지 않도록 여백 */
body.ta-open .task-card .task-title { padding-right: 22px; }

/* 워크스페이스 하단 여백 — 떠 있는 패널에 가리지 않게 */
body.ta-open .workspace { padding-bottom: 280px; }

/* 떠 있는 도크 패널 */
.ta-panel {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(540px, calc(100vw - 32px));
  z-index: 320;
  background: linear-gradient(180deg, #1a212c, #141a23);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
  animation: ta-rise 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.ta-panel[hidden] { display: none; }

@keyframes ta-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.ta-panel-inner {
  display: flex;
  flex-direction: column;
  max-height: min(56vh, 560px);
}

/* 헤더 */
.ta-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px 13px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.ta-panel-brand {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #ff8a6b, #f5a623);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ta-panel-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ta-meta-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-raised);
  border-radius: 999px;
  padding: 2px 9px;
}
.ta-meta-total { font-size: 0.8rem; color: #f3b14d; font-weight: 600; }
.ta-panel-hint { font-size: 0.8rem; color: var(--muted); }
.ta-panel-hint strong { color: #f3b14d; }

.ta-panel-close {
  min-height: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s;
}
.ta-panel-close:hover { background: var(--surface); color: var(--text); }

/* 큐 리스트 */
.ta-queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ta-queue-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
}
.ta-queue-empty-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px dashed var(--line-strong);
  font-size: 1.5rem;
  color: var(--muted);
}
.ta-queue-empty p { margin: 0; font-size: 0.86rem; line-height: 1.5; }
.ta-queue-empty strong { color: #f3b14d; }

/* 큐 아이템 */
.ta-queue-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cat-color, var(--line-strong));
  border-radius: 9px;
  transition: border-color 0.14s, background 0.14s, transform 0.1s;
}
.ta-queue-item.ta-drag-over {
  border-color: #f59e0b;
  background: #f59e0b10;
}
.ta-queue-item:active { cursor: grabbing; }

.ta-queue-handle {
  color: var(--line-strong);
  cursor: grab;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.ta-queue-handle:hover { color: var(--muted); }

.ta-queue-num {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ta-queue-title {
  flex: 1;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 분 입력 필드 */
.ta-est-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 8px 2px 4px;
  flex-shrink: 0;
  transition: border-color 0.14s;
}
.ta-est-field:focus-within { border-color: #f59e0b; }
.ta-est-input {
  min-height: 0;
  width: 34px;
  padding: 3px 2px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
  outline: none;
  -moz-appearance: textfield;
}
.ta-est-input::-webkit-outer-spin-button,
.ta-est-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ta-est-input::placeholder { color: var(--line-strong); font-weight: 400; }
.ta-est-unit { font-size: 0.72rem; color: var(--muted); flex-shrink: 0; }

.ta-queue-remove {
  min-height: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s;
}
.ta-queue-remove:hover { background: #e5484d22; color: #e5484d; }

/* 푸터 + 시작 버튼 */
.ta-panel-footer {
  padding: 11px 14px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.ta-start-btn {
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff7a5c, #f5a623);
  color: #1a1205;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(245, 166, 35, 0.32);
  transition: transform 0.12s, box-shadow 0.18s, filter 0.15s;
}
.ta-start-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(245, 166, 35, 0.42);
  filter: brightness(1.04);
}
.ta-start-btn:disabled {
  background: var(--surface-raised);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}
.ta-start-time {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(26, 18, 5, 0.16);
  border-radius: 999px;
  padding: 2px 10px;
}
.ta-start-btn:disabled .ta-start-time { background: rgba(255,255,255,0.05); }
.ta-finish-btn { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 6px 18px rgba(16,185,129,0.32); }

/* 실행 중 헤더 */
.ta-run-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.ta-clock {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.ta-clock-ring { display: block; }
.ta-ring-bg { fill: none; stroke: var(--line); stroke-width: 7; }
.ta-ring-fill {
  fill: none;
  stroke: #f5a623;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.ta-ring-fill.is-overtime { stroke: #e5484d; }
.ta-clock-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ta-clock-time {
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ta-clock-time.is-overtime { color: #e5484d; }
.ta-clock-label { font-size: 0.5rem; color: var(--muted); margin-top: 1px; }

.ta-run-progress-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ta-run-progress-top { display: flex; align-items: baseline; gap: 6px; }
.ta-run-progress-count { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ta-run-progress-total { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.ta-run-progress-label { font-size: 0.74rem; color: var(--muted); }
.ta-run-bar { height: 5px; background: var(--surface-raised); border-radius: 999px; overflow: hidden; }
.ta-run-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #10b981);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* 실행 중 항목 */
.ta-run-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cat-color, var(--line-strong));
  border-radius: 9px;
  cursor: pointer;
  transition: opacity 0.16s, background 0.14s;
}
.ta-run-row:hover { background: var(--surface-raised); }
.ta-run-row.is-done { opacity: 0.5; }
.ta-run-row.is-done .ta-run-title { text-decoration: line-through; }
.ta-run-check {
  min-height: 0;
  width: 18px;
  height: 18px;
  accent-color: #10b981;
  flex-shrink: 0;
  cursor: pointer;
}
.ta-run-num {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ta-run-title { flex: 1; font-size: 0.88rem; }
.ta-run-est { font-size: 0.74rem; color: var(--muted); flex-shrink: 0; }

/* 완료 화면 */
.ta-panel-done { position: relative; }
.ta-done-close { position: absolute; top: 8px; right: 8px; z-index: 2; }
.ta-done-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 24px 26px;
}
.ta-done-icon { font-size: 3rem; line-height: 1; }
.ta-done-icon.is-perfect { animation: ta-pop 0.5s cubic-bezier(0.18, 1.4, 0.4, 1); }
@keyframes ta-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}
.ta-done-title { margin: 4px 0 0; font-size: 1.35rem; font-weight: 800; }
.ta-done-sub { margin: 0 0 18px; font-size: 0.84rem; color: var(--muted); }
.ta-retry-btn { width: auto; padding: 11px 30px; }

/* 모바일 */
@media (max-width: 640px) {
  .ta-panel { bottom: 12px; width: calc(100vw - 20px); }
  body.ta-open .workspace { padding-bottom: 300px; }
}

@media (max-width: 720px) {
  .member-backdrop {
    align-items: start;
    padding: 10px;
  }

  .member-panel {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .member-panel-grid {
    grid-template-columns: 1fr;
  }

  .usage-panel-body {
    padding: 16px;
  }

  .usage-summary-grid,
  .usage-limit-list {
    grid-template-columns: 1fr;
  }

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