    :root {
      color-scheme: light;
      --ink: #4b3528;
      --muted: #8a7465;
      --line: #e3d3c2;
      --paper: #fffaf2;
      --wash: #f5ebdd;
      --navy: #5a3b2c;
      --teal: #8b5e3c;
      --green: #6d7b4b;
      --amber: #b8874a;
      --rose: #a96d60;
      --blue: #7d715f;
      --shadow: 0 16px 34px rgba(82, 56, 39, 0.12);
      font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      background:
        radial-gradient(circle at 12% 10%, rgba(139, 94, 60, 0.12), transparent 30%),
        linear-gradient(135deg, #fbf3e7 0%, #f4eadc 48%, #efe0cf 100%);
      color: var(--ink);
    }

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

    button {
      cursor: pointer;
    }

    .app {
      display: grid;
      grid-template-columns: 260px 1fr;
      min-height: 100vh;
    }

    aside {
      position: sticky;
      top: 0;
      height: 100vh;
      padding: 24px 18px;
      background: var(--navy);
      color: #fff8ef;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 26px;
    }

    .brand-mark {
      display: grid;
      place-items: center;
      width: 42px;
      height: 42px;
      border-radius: 8px;
      background: linear-gradient(145deg, #e8c691, #a9764f);
      color: #4a3022;
      font-weight: 900;
    }

    .brand strong {
      display: block;
      font-size: 1.08rem;
    }

    .brand span {
      display: block;
      margin-top: 2px;
      color: #e4d1be;
      font-size: 0.78rem;
    }

    nav {
      display: grid;
      gap: 8px;
    }

    .nav-button {
      display: grid;
      grid-template-columns: 28px 1fr;
      align-items: center;
      width: 100%;
      min-height: 42px;
      border: 0;
      border-radius: 8px;
      padding: 9px 11px;
      background: transparent;
      color: #f1dfcc;
      text-align: left;
    }

    .nav-button:hover,
    .nav-button.active {
      background: rgba(255, 248, 239, 0.14);
      color: #fff8ef;
    }

    .side-note {
      margin-top: 26px;
      padding: 14px;
      border: 1px solid rgba(255, 248, 239, 0.18);
      border-radius: 8px;
      background: rgba(255, 248, 239, 0.08);
      color: #ead9c7;
      font-size: 0.86rem;
      line-height: 1.55;
    }

    main {
      min-width: 0;
      padding: 22px;
    }

    .topbar {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 16px;
      align-items: center;
      margin-bottom: 18px;
    }

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

    h1 {
      margin-bottom: 5px;
      font-size: clamp(1.65rem, 3vw, 2.25rem);
      letter-spacing: 0;
    }

    .subtitle {
      margin-bottom: 0;
      color: var(--muted);
      line-height: 1.55;
    }

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

    .button {
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px 12px;
      background: var(--paper);
      color: var(--ink);
      font-weight: 700;
    }

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

    .button.danger {
      border-color: #e4c0b8;
      background: #fff3ee;
      color: #8a463c;
    }

    .dashboard {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 18px;
    }

    .metric {
      min-height: 104px;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255, 250, 242, 0.9);
      box-shadow: var(--shadow);
    }

    .metric span {
      display: block;
      color: var(--muted);
      font-size: 0.82rem;
    }

    .metric strong {
      display: block;
      margin-top: 8px;
      font-size: 1.65rem;
    }

    .metric small {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      line-height: 1.35;
    }

    .workspace {
      display: grid;
      grid-template-columns: minmax(320px, 430px) 1fr;
      gap: 18px;
      align-items: start;
    }

    .panel,
    .list-panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255, 250, 242, 0.94);
      box-shadow: var(--shadow);
    }

    .panel {
      padding: 18px;
    }

    .panel-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }

    .panel-header h2 {
      margin-bottom: 4px;
      font-size: 1.08rem;
    }

    .panel-header p {
      margin-bottom: 0;
      color: var(--muted);
      font-size: 0.88rem;
      line-height: 1.45;
    }

    form {
      display: grid;
      gap: 16px;
    }

    fieldset {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin: 0;
      padding: 0;
      border: 0;
    }

    legend {
      grid-column: 1 / -1;
      margin-bottom: -2px;
      color: var(--teal);
      font-weight: 800;
      font-size: 0.92rem;
    }

    label {
      display: grid;
      gap: 6px;
      color: #5b4031;
      font-size: 0.84rem;
      font-weight: 700;
    }

    input,
    select,
    textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 9px 10px;
      background: #fffdf8;
      color: var(--ink);
      outline: none;
    }

    textarea {
      min-height: 92px;
      resize: vertical;
      line-height: 1.5;
    }

    input:focus,
    select:focus,
    textarea:focus {
      border-color: var(--teal);
      box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.14);
    }

    .wide {
      grid-column: 1 / -1;
    }

    .range-row {
      display: grid;
      grid-template-columns: 1fr 44px;
      gap: 10px;
      align-items: center;
    }

    .grind-row {
      display: grid;
      grid-template-columns: 1fr 24px 1fr auto;
      gap: 8px;
      align-items: center;
    }

    .grind-row span {
      color: var(--muted);
      font-weight: 800;
    }

    .grind-row .tilde {
      text-align: center;
    }

    .recipe-ratio input,
    .recipe-temp input {
      max-width: none;
      width: 100%;
    }

    .recipe-grind .grind-row {
      max-width: 520px;
    }

    input[type="range"] {
      padding: 0;
      accent-color: var(--teal);
    }

    .step-builder {
      display: grid;
      gap: 10px;
    }

    .step-row {
      display: grid;
      grid-template-columns: 156px 96px 1fr 38px;
      gap: 8px;
      align-items: center;
    }

    .step-row input {
      min-width: 0;
    }

    .time-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }

    .step-preview {
      min-height: 48px;
      border: 1px dashed #d9bfa4;
      border-radius: 8px;
      padding: 10px;
      background: #fff7ec;
      color: var(--muted);
      font-size: 0.86rem;
      line-height: 1.55;
      white-space: pre-line;
    }

    .step-tools {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .tabs {
      display: flex;
      gap: 6px;
      padding: 10px;
      border-bottom: 1px solid var(--line);
    }

    .tab {
      border: 1px solid transparent;
      border-radius: 8px;
      padding: 8px 11px;
      background: transparent;
      color: var(--muted);
      font-weight: 800;
    }

    .tab.active {
      border-color: #d9bfa4;
      background: #f8ead8;
      color: #6c442c;
    }

    .list-tools {
      display: grid;
      grid-template-columns: 1fr 170px;
      gap: 10px;
      padding: 12px;
      border-bottom: 1px solid var(--line);
    }

    .entry-list {
      display: grid;
      gap: 10px;
      padding: 12px;
      max-height: calc(100vh - 302px);
      min-height: 420px;
      overflow: auto;
    }

    .entry {
      display: grid;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 13px;
      background: #fffaf2;
    }

    .entry-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }

    .entry h3 {
      margin-bottom: 4px;
      font-size: 1rem;
    }

    .entry p {
      margin-bottom: 0;
      color: var(--muted);
      font-size: 0.88rem;
      line-height: 1.5;
    }

    .steps-output {
      white-space: pre-line;
    }

    .tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .tag {
      border-radius: 999px;
      padding: 4px 8px;
      background: #f4eadc;
      color: #6a4d3b;
      font-size: 0.75rem;
      font-weight: 800;
    }

    .tag.green {
      background: #eef2e4;
      color: #5f6e3f;
    }

    .tag.amber {
      background: #fff1dc;
      color: #8d5d22;
    }

    .tag.rose {
      background: #fff0eb;
      color: #955448;
    }

    .entry-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
    }

    .mini-button {
      min-width: 34px;
      min-height: 32px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--paper);
      color: #5a3b2c;
      font-weight: 800;
    }

    .empty {
      display: grid;
      place-items: center;
      min-height: 280px;
      padding: 26px;
      color: var(--muted);
      text-align: center;
      line-height: 1.6;
    }

    .hidden {
      display: none !important;
    }

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

      aside {
        position: static;
        height: auto;
      }

      nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }

      .side-note {
        display: none;
      }

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

      .entry-list {
        max-height: none;
      }
    }

    @media (max-width: 760px) {
      main {
        padding: 16px;
      }

      .topbar,
      .dashboard,
      .list-tools,
      fieldset,
      .grind-row,
      .step-row {
        grid-template-columns: 1fr;
      }

      nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .actions {
        justify-content: stretch;
      }

      .button,
      .nav-button {
        width: 100%;
      }
    }

    body:not(.authenticated) .app {
      display: none;
    }

    body.authenticated .auth-screen {
      display: none;
    }

    .auth-screen {
      display: grid;
      place-items: center;
      min-height: 100vh;
      padding: 24px;
    }

    .auth-card {
      display: grid;
      grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 420px);
      width: min(920px, 100%);
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255, 250, 242, 0.95);
      box-shadow: var(--shadow);
    }

    .auth-copy {
      display: grid;
      align-content: center;
      gap: 12px;
      min-height: 520px;
      padding: 42px;
      background:
        linear-gradient(rgba(90, 59, 44, 0.76), rgba(90, 59, 44, 0.7)),
        url("https://images.unsplash.com/photo-1495474472287-4d71bcdd2085?auto=format&fit=crop&w=1000&q=80") center / cover;
      color: #fff8ef;
    }

    .auth-mark {
      display: grid;
      place-items: center;
      width: 52px;
      height: 52px;
      border-radius: 8px;
      background: #e8c691;
      color: #4a3022;
      font-weight: 900;
    }

    .auth-kicker {
      margin: 8px 0 0;
      color: #ead9c7;
      font-weight: 800;
    }

    .auth-copy h1 {
      margin-bottom: 0;
      font-size: clamp(1.9rem, 4vw, 3rem);
      line-height: 1.12;
    }

    .auth-copy p:last-child {
      margin-bottom: 0;
      max-width: 440px;
      color: #f0dfcc;
      line-height: 1.65;
    }

    .auth-panel {
      display: grid;
      align-content: center;
      gap: 18px;
      padding: 34px;
    }

    .auth-tabs {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 6px;
      padding: 5px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f5ebdd;
    }

    .auth-tab {
      min-height: 38px;
      border: 0;
      border-radius: 7px;
      background: transparent;
      color: var(--muted);
      font-weight: 800;
    }

    .auth-tab.active {
      background: var(--paper);
      color: var(--ink);
      box-shadow: 0 8px 18px rgba(82, 56, 39, 0.08);
    }

    .auth-form {
      display: grid;
      gap: 14px;
    }

    .auth-message {
      min-height: 22px;
      margin: 0;
      color: var(--rose);
      font-size: 0.9rem;
      font-weight: 700;
      line-height: 1.45;
    }

    .user-chip {
      align-self: center;
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 7px 10px;
      background: #fffdf8;
      color: var(--muted);
      font-size: 0.86rem;
      font-weight: 800;
    }

    @media (max-width: 760px) {
      .auth-screen {
        padding: 16px;
      }

      .auth-card {
        grid-template-columns: 1fr;
      }

      .auth-copy {
        min-height: 280px;
        padding: 28px;
      }

      .auth-panel {
        padding: 24px;
      }
    }
