*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --card: #131316;
  --raised: #1b1b20;
  --line: #2a2a31;
  --line-strong: #3a3a43;
  --text: #ffffff;
  --muted: #a8a8b0;
  --dim: #74747e;
  --lime: #d6ff3e;
  --lime-soft: rgba(214, 255, 62, 0.1);
  --danger: #ff8f9f;
  --danger-soft: rgba(255, 93, 116, 0.1);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
  font-synthesis: none;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% -10%, rgba(214, 255, 62, 0.055), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

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

button,
select,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
select,
summary {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #686871;
}

input[type='text'],
input[type='password'],
input[type='search'],
input[type='url'],
input[type='date'],
select {
  min-height: 46px;
  padding: 0 13px;
  font-size: 1rem;
}

textarea {
  width: 100%;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.55;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--lime);
}

form {
  margin: 0;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
}

.skip-link,
.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;
}

.skip-link:focus {
  z-index: 100;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--lime);
  color: #0b0b0d;
  font-weight: 700;
}

.primary-button,
.complete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  background: var(--lime);
  color: #101105;
  transition: transform 150ms ease, background 150ms ease;
}

.primary-button:hover,
.complete-button:hover {
  background: #e2ff74;
  transform: translateY(-1px);
}

.quiet-button {
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
}

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

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notice {
  margin: 0 0 24px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.9rem;
}

.notice-error {
  border-color: #63313a;
  background: var(--danger-soft);
  color: #ffb0bc;
}

/* 로그인 */

.login-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 430px);
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(19, 19, 22, 0.92);
  box-shadow: var(--shadow);
}

.login-brand,
.brand {
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-decoration: none;
}

.login-card .eyebrow {
  margin-top: 48px;
}

.login-card h1 {
  margin: 9px 0 0;
  font-size: clamp(2rem, 8vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.login-copy {
  margin: 14px 0 30px;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 50px;
}

.login-form button {
  margin-top: 6px;
  min-height: 50px;
}

.login-footnote {
  margin: 24px 0 0;
  color: var(--dim);
  font-size: 0.78rem;
}

/* 전체 골격 */

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

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(42, 42, 49, 0.82);
  background: rgba(11, 11, 13, 0.86);
  backdrop-filter: blur(18px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sync-state {
  color: var(--dim);
  font-size: 0.76rem;
}

.sync-state::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: var(--lime);
  content: '';
}

.workspace {
  width: min(calc(100% - 48px), 1180px);
  margin: 0 auto;
  padding: 68px 0 44px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 44px;
}

.hero h1 {
  margin: 8px 0 0;
  font-size: clamp(2.45rem, 6vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.065em;
}

.hero-copy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.hero-stats {
  display: flex;
  gap: 8px;
}

.hero-stats div {
  display: grid;
  min-width: 94px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.hero-stats strong {
  font-size: 1.35rem;
  line-height: 1;
}

.hero-stats span {
  margin-top: 7px;
  color: var(--dim);
  font-size: 0.72rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.section-heading,
.list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2,
.list-heading h2 {
  margin: 4px 0 0;
  font-size: 1.18rem;
  letter-spacing: -0.025em;
}

.section-heading > p,
.list-heading > span {
  margin: 0;
  color: var(--dim);
  font-size: 0.82rem;
}

/* 빠른 추가 */

.quick-add {
  padding: 22px;
}

.quick-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px auto;
  gap: 10px;
  margin-top: 18px;
}

.quick-add-form .title-input {
  width: 100%;
  min-height: 50px;
  padding-inline: 16px;
  background: var(--raised);
}

.quick-add-form > select {
  min-height: 50px;
  background: var(--raised);
}

.add-button {
  min-height: 50px;
}

.quick-details {
  grid-column: 1 / -1;
  margin-top: 3px;
}

.quick-details > summary,
.notes-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  list-style: none;
}

.quick-details > summary::-webkit-details-marker,
.notes-details > summary::-webkit-details-marker,
.more-menu > summary::-webkit-details-marker,
.delete-confirm > summary::-webkit-details-marker {
  display: none;
}

.quick-details > summary::before,
.notes-details > summary::before {
  margin-right: 7px;
  color: var(--lime);
  content: '+';
}

.quick-details[open] > summary::before,
.notes-details[open] > summary::before {
  content: '−';
}

.detail-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.55fr) minmax(0, 1fr);
  gap: 12px;
  padding-top: 6px;
}

.detail-fields label,
.edit-form label {
  display: grid;
  align-content: start;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.detail-fields textarea {
  min-height: 92px;
}

/* 초점 카드 */

.focus-card {
  position: relative;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-top: 16px;
  padding: 24px 24px 24px 0;
  overflow: hidden;
  border: 1px solid rgba(214, 255, 62, 0.23);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(214, 255, 62, 0.075), rgba(19, 19, 22, 0.96) 48%);
}

.focus-marker {
  width: 4px;
  height: 100%;
  min-height: 72px;
  border-radius: 0 4px 4px 0;
  background: var(--lime);
}

.focus-main h2 {
  margin: 5px 0 0;
  font-size: clamp(1.18rem, 3vw, 1.45rem);
  letter-spacing: -0.03em;
}

.focus-main > p:not(.section-kicker) {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.complete-button {
  white-space: nowrap;
}

/* 필터 */

.task-section {
  margin-top: 54px;
}

.filters-panel {
  border-bottom: 1px solid var(--line);
}

.tabs-scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-scroll::-webkit-scrollbar {
  display: none;
}

.tabs {
  display: flex;
  min-width: max-content;
  gap: 24px;
}

.tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--dim);
  font-size: 0.91rem;
  font-weight: 700;
  text-decoration: none;
}

.tabs a:hover,
.tabs a[aria-current='page'] {
  color: var(--text);
}

.tabs a[aria-current='page']::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--lime);
  content: '';
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chips a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.chips a:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chips a[aria-current='page'] {
  border-color: rgba(214, 255, 62, 0.35);
  background: var(--lime-soft);
  color: var(--lime);
}

.search-form {
  display: flex;
  flex: 0 1 280px;
  gap: 7px;
}

.search-form input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  background: var(--card);
}

.search-form button,
.status-form button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--muted);
  font-size: 0.78rem;
}

.search-form button:hover,
.status-form button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.list-heading {
  margin-top: 30px;
}

/* 할 일 카드 */

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

.task-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: border-color 150ms ease, background 150ms ease;
}

.task-card:hover {
  border-color: var(--line-strong);
  background: #151519;
}

.task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  align-items: start;
  padding: 17px;
}

.toggle-form {
  padding-top: 2px;
}

.check-button {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: #111105;
}

.check-button span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.78rem;
  line-height: 1;
}

.check-button:hover {
  border-color: var(--lime);
}

.is-done .check-button {
  border-color: var(--lime);
  background: var(--lime);
}

.is-done .check-button span::after {
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-bottom: 2px solid #111105;
  border-left: 2px solid #111105;
  content: '';
  transform: rotate(-45deg);
}

.task-content {
  min-width: 0;
  padding-top: 2px;
}

.task-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-title-line h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.is-done .task-title-line h3 {
  color: var(--dim);
  text-decoration: line-through;
  text-decoration-color: #55555e;
}

.category-badge,
.category-dot {
  display: inline-flex;
  flex: none;
  align-items: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.category-badge {
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.category-dot::before {
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--lime);
  content: '';
}

.category-공연::before {
  background: #a89cff;
}

.category-개인::before {
  background: #73cdf3;
}

.category-badge.category-공연 {
  border-color: rgba(168, 156, 255, 0.25);
  color: #c0b7ff;
}

.category-badge.category-개인 {
  border-color: rgba(115, 205, 243, 0.24);
  color: #9bdcf7;
}

.category-badge.category-acttub {
  border-color: rgba(214, 255, 62, 0.25);
  color: #d6ff72;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  align-items: center;
  margin-top: 8px;
  color: var(--dim);
  font-size: 0.75rem;
}

.task-meta span + span::before,
.task-meta span + a::before,
.task-meta a + span::before,
.task-meta a + a::before {
  margin-right: 13px;
  color: #46464f;
  content: '·';
}

.task-meta a {
  color: var(--muted);
  text-decoration-color: #55555e;
  text-underline-offset: 3px;
}

.task-meta a:hover {
  color: var(--lime);
}

.task-meta .overdue {
  color: #ff9baa;
}

.notes-details {
  margin-top: 3px;
}

.notes-details p {
  max-width: 70ch;
  margin: 1px 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.status-form select {
  min-height: 42px;
  padding-right: 30px;
  background: var(--raised);
  color: var(--muted);
  font-size: 0.78rem;
}

.more-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  list-style: none;
}

.more-menu > summary:hover,
.more-menu[open] > summary {
  border-color: var(--line-strong);
  color: var(--text);
}

.edit-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + 10px);
  right: 0;
  width: min(430px, calc(100vw - 48px));
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--raised);
  box-shadow: var(--shadow);
}

.edit-form {
  display: grid;
  gap: 13px;
}

.edit-form h4 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.edit-form input,
.edit-form select {
  width: 100%;
}

.edit-form textarea,
.edit-form input,
.edit-form select {
  background: var(--card);
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 10px;
}

.edit-form .primary-button {
  justify-self: start;
  margin-top: 2px;
}

.delete-confirm {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.delete-confirm > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
  list-style: none;
}

.delete-confirm p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.danger-button {
  padding: 0 14px;
  border: 1px solid #6a3440;
  background: var(--danger-soft);
  color: #ffacb8;
}

.danger-button:hover {
  border-color: #98505d;
  color: #ffd1d8;
}

.empty-state {
  display: grid;
  min-height: 220px;
  margin-top: 16px;
  place-content: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
}

.empty-state p {
  margin: 0;
  font-weight: 700;
}

.empty-state span {
  margin-top: 7px;
  color: var(--dim);
  font-size: 0.82rem;
}

.workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 54px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.73rem;
}

.workspace-footer p {
  margin: 0;
}

@media (max-width: 800px) {
  .workspace {
    width: min(calc(100% - 32px), 1180px);
    padding-top: 48px;
  }

  .hero {
    align-items: start;
  }

  .hero-stats {
    flex-direction: column;
  }

  .hero-stats div {
    min-width: 84px;
    padding: 12px 14px;
  }

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

  .detail-fields label:first-child {
    grid-column: 1 / -1;
  }

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

  .task-controls {
    grid-column: 2;
    justify-content: flex-start;
  }

  .edit-panel {
    right: auto;
    left: 0;
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 58px;
    padding: 0 16px;
  }

  .sync-state {
    display: none;
  }

  .workspace {
    width: calc(100% - 28px);
    padding: 38px 0 32px;
  }

  .hero {
    display: block;
    margin-bottom: 32px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 13vw, 3.2rem);
  }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 26px;
  }

  .hero-stats div {
    min-width: 0;
  }

  .quick-add {
    padding: 17px;
  }

  .section-heading > p {
    display: none;
  }

  .quick-add-form {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .quick-add-form .title-input {
    grid-column: 1 / -1;
  }

  .add-button {
    padding-inline: 14px;
  }

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

  .detail-fields label:first-child {
    grid-column: auto;
  }

  .focus-card {
    grid-template-columns: 4px minmax(0, 1fr);
    gap: 16px;
    padding: 20px 18px 20px 0;
  }

  .focus-action {
    grid-column: 2;
  }

  .focus-action button {
    width: 100%;
  }

  .task-section {
    margin-top: 42px;
  }

  .tabs {
    gap: 20px;
  }

  .filter-row {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chips a {
    flex: none;
    min-height: 44px;
  }

  .search-form {
    flex-basis: auto;
  }

  .search-form input,
  .search-form button {
    min-height: 46px;
  }

  .task-row {
    gap: 11px;
    padding: 14px;
  }

  .task-title-line {
    align-items: start;
    flex-direction: column;
    gap: 7px;
  }

  .task-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .status-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .status-form select,
  .status-form button,
  .more-menu > summary {
    min-height: 44px;
  }

  .edit-panel {
    right: 0;
    left: auto;
    width: min(430px, calc(100vw - 42px));
    max-height: calc(100vh - 110px);
    max-height: calc(100svh - 110px);
    overflow-y: auto;
  }

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

  .edit-grid label:last-child {
    grid-column: 1 / -1;
  }

  .workspace-footer {
    display: grid;
    gap: 7px;
    margin-top: 42px;
  }
}

@media (max-width: 390px) {
  .login-page {
    padding: 14px;
  }

  .login-card {
    padding: 26px 20px;
  }

  .quick-add-form {
    grid-template-columns: minmax(0, 1fr) 98px;
  }

  .task-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

}

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