@import url("https://fonts.googleapis.com/css2?family=Permanent+Marker&family=Playfair+Display:wght@600;700&family=Poppins:wght@400;500;600;700;800&display=swap");

:root {
  color: #000000;
  background: #f2f1eb;
  --brand-white: #ffffff;
  --brand-cream: #f2f1eb;
  --brand-taupe: #cbbfb1;
  --brand-black: #000000;
  --soft-taupe: #e5ded5;
  --deep-taupe: #86796c;
  font-family:
    "Poppins", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.18fr);
  min-height: 100vh;
  background: var(--brand-cream);
}

.capture-panel,
.library-panel {
  padding: clamp(18px, 3vw, 42px);
}

.capture-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(0, 0, 0, 0.13);
  background:
    radial-gradient(circle at 14% 18%, rgba(203, 191, 177, 0.3), transparent 28%),
    var(--brand-cream);
}

.topbar,
.recorder,
.draft-actions,
.button-row,
.detail-head,
.detail-actions,
.search-wrap,
.status {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--deep-taupe);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 10ch;
  margin-bottom: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(3.1rem, 7.4vw, 6.9rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin: 3px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}

.note-detail h2 {
  max-width: 18ch;
  overflow-wrap: anywhere;
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  line-height: 1.08;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  color: var(--brand-black);
  background: rgba(255, 255, 255, 0.76);
}

.icon-button:hover {
  background: #ffffff;
}

.icon-button.danger {
  color: var(--brand-black);
}

.recorder {
  gap: 18px;
}

.record-button {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  color: var(--brand-white);
  background: var(--brand-black);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.record-button:hover {
  transform: translateY(-2px);
}

.record-button.recording {
  color: var(--brand-black);
  background: var(--brand-taupe);
  box-shadow: 0 0 0 12px rgba(203, 191, 177, 0.25), 0 18px 42px rgba(0, 0, 0, 0.16);
}

.record-state {
  margin-bottom: 4px;
  font-size: 1.35rem;
  font-weight: 800;
}

.record-detail {
  max-width: 25ch;
  margin: 0;
  color: #5e554d;
  line-height: 1.5;
}

.status {
  gap: 10px;
  padding: 13px 14px;
  border-radius: 8px;
  color: var(--brand-black);
  background: var(--brand-taupe);
}

.draft-label {
  color: #5e554d;
  font-size: 0.9rem;
  font-weight: 800;
}

textarea {
  width: 100%;
  resize: none;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  outline: none;
  color: var(--brand-black);
  background: rgba(255, 255, 255, 0.78);
}

#draft {
  min-height: 260px;
  padding: 18px;
  font-size: 1.12rem;
  line-height: 1.55;
}

textarea:focus,
input:focus {
  border-color: var(--brand-black);
  box-shadow: 0 0 0 3px rgba(203, 191, 177, 0.45);
}

.draft-actions {
  justify-content: space-between;
  gap: 16px;
  color: #5e554d;
  flex-wrap: wrap;
}

.button-row {
  gap: 10px;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
}

.primary {
  border: 0;
  color: var(--brand-white);
  background: var(--brand-black);
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary {
  border: 1px solid rgba(0, 0, 0, 0.16);
  color: var(--brand-black);
  background: rgba(255, 255, 255, 0.6);
}

.library-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.search-wrap {
  gap: 10px;
  min-height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.82);
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  min-height: 0;
  flex: 1;
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.note-row {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 116px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  color: var(--brand-black);
  background: rgba(255, 255, 255, 0.55);
}

.note-row:hover,
.note-row.active {
  border-color: var(--brand-black);
  background: var(--brand-white);
}

.note-title {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-preview {
  display: -webkit-box;
  overflow: hidden;
  color: #5e554d;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6c6258;
  font-size: 0.82rem;
}

.note-detail {
  min-width: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 32px);
  background: rgba(255, 255, 255, 0.72);
  overflow: auto;
}

.detail-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.detail-head p {
  margin: 0;
  color: #6c6258;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-actions {
  gap: 8px;
}

.saved-text {
  max-width: 72ch;
  margin: 0;
  white-space: pre-wrap;
  color: #161616;
  font-size: 1.08rem;
  line-height: 1.7;
}

.edit-text {
  min-height: 420px;
  padding: 16px;
  line-height: 1.62;
}

.title-input {
  width: min(100%, 560px);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--brand-black);
  background: #fff;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  gap: 8px;
  border: 1px dashed rgba(0, 0, 0, 0.24);
  border-radius: 8px;
  color: #5e554d;
  text-align: center;
}

.detail-empty {
  height: 100%;
}

@media (max-width: 980px) {
  .app-shell,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .capture-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  }

  h1 {
    max-width: 12ch;
  }
}

@media (max-width: 620px) {
  .topbar,
  .detail-head {
    align-items: flex-start;
  }

  .recorder {
    align-items: flex-start;
  }

  .record-button {
    width: 86px;
    height: 86px;
  }

  .button-row,
  .draft-actions {
    width: 100%;
  }

  .primary,
  .secondary {
    justify-content: center;
    flex: 1 1 130px;
  }
}
