:root {
  color-scheme: light;
  --bg: #f4eee5;
  --bg-strong: #e8dccb;
  --panel: rgba(255, 251, 245, 0.82);
  --panel-strong: rgba(255, 248, 240, 0.94);
  --ink: #1a1510;
  --muted: #6e6257;
  --line: rgba(26, 21, 16, 0.12);
  --accent: #bf5b2c;
  --accent-deep: #8e3d16;
  --shadow: 0 24px 80px rgba(38, 22, 8, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 38%),
    linear-gradient(135deg, #f7efe4 0%, #f2e7d8 46%, #eadbc8 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.backdrop {
  position: fixed;
  inset: auto;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  filter: blur(26px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.backdrop-left {
  top: -12rem;
  left: -9rem;
  background: radial-gradient(circle, rgba(234, 188, 134, 0.78), transparent 70%);
}

.backdrop-right {
  right: -8rem;
  bottom: -14rem;
  background: radial-gradient(circle, rgba(188, 91, 44, 0.2), transparent 72%);
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 42px;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  padding: 28px;
  display: grid;
  gap: 22px;
  position: sticky;
  top: 24px;
}

.eyebrow,
.section-label,
.credential-label,
.note-path,
.updated-at,
.hint-text {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.eyebrow,
.section-label,
.credential-label,
.updated-at,
.hint-text {
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(48px, 8vw, 76px);
  line-height: 0.95;
}

h2 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
}

.hero-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 16px;
}

.actions-grid {
  display: grid;
  gap: 18px;
}

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

.open-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 18px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fffaf5;
  box-shadow: 0 18px 36px rgba(191, 91, 44, 0.26);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: rgba(26, 21, 16, 0.08);
}

.ghost-btn {
  background: transparent;
  color: var(--ink);
  border-color: rgba(26, 21, 16, 0.08);
}

.danger-btn {
  background: rgba(138, 40, 25, 0.08);
  color: #8d2f25;
  border-color: rgba(138, 40, 25, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(26, 21, 16, 0.09);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

input {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 14px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(191, 91, 44, 0.45);
  box-shadow: 0 0 0 4px rgba(191, 91, 44, 0.08);
}

.credential-card {
  background: var(--panel-strong);
  border: 1px solid rgba(26, 21, 16, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: grid;
  gap: 16px;
}

.credential-head {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.credential-code,
.credential-pin {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.credential-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor {
  padding: 26px;
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 78px);
}

.editor-top,
.editor-toolbar,
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-heading {
  display: grid;
  gap: 6px;
}

.editor-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  min-width: 92px;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(26, 21, 16, 0.07);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.status-pill.is-saving {
  color: #7e4a18;
  background: rgba(255, 225, 178, 0.65);
}

.status-pill.is-saved {
  color: #236346;
  background: rgba(199, 246, 217, 0.68);
}

.status-pill.is-live {
  color: #1f5c70;
  background: rgba(205, 237, 247, 0.78);
}

.status-pill.is-error {
  color: #8d2f25;
  background: rgba(255, 216, 210, 0.78);
}

.status-pill.is-dirty {
  color: #6a4b18;
  background: rgba(255, 236, 199, 0.78);
}

.note-path {
  color: var(--ink);
}

.note-input {
  flex: 1;
  min-height: 52vh;
  resize: vertical;
  border-radius: 24px;
  padding: 24px 24px 28px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background: rgba(255, 253, 250, 0.82);
}

.hint-text {
  max-width: 48rem;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

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

  .hero {
    position: static;
  }

  .editor {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 16px 14px 20px;
  }

  .hero,
  .editor {
    padding: 20px;
    border-radius: 24px;
  }

  .credential-head,
  .editor-top,
  .editor-toolbar,
  .editor-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .editor-meta,
  .credential-actions {
    width: 100%;
  }

  .editor-meta > * ,
  .credential-actions > * {
    flex: 1;
  }

  .note-input {
    min-height: 46vh;
    padding: 18px;
  }
}
