:root {
  --diary-sidebar: 318px;
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.98), transparent 31rem),
    radial-gradient(circle at 88% 92%, rgba(201, 178, 255, 0.28), transparent 34rem),
    linear-gradient(155deg, #fcf9ff 0%, #f5efff 48%, #f7fbff 100%);
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(139, 92, 246, 0.24);
  outline-offset: 3px;
}

.nav-back,
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.shell {
  width: min(1420px, calc(100% - 48px));
  max-width: none;
  grid-template-columns: var(--diary-sidebar) minmax(0, 1fr);
  gap: 18px;
  padding: 78px 0 32px;
}

.panel {
  border-color: rgba(231, 221, 243, 0.86);
  box-shadow: 0 24px 64px rgba(87, 58, 123, 0.1);
}

.sidebar {
  position: sticky;
  top: 78px;
  align-self: start;
  height: calc(100vh - 110px);
  min-height: 650px;
  padding: 24px 20px 18px;
  overflow: hidden;
}

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

.diary-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #e8dcf8;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 21px;
}

.eyebrow,
.timeline-heading,
.entry-day-label {
  color: #8a7d9a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.diary-brand h1 {
  margin: 2px 0 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.sidebar-subtitle {
  margin-top: 0;
  line-height: 1.65;
}

.privacy-note {
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid #e7ddf3;
  border-radius: 14px;
  background: rgba(249, 246, 253, 0.82);
  color: #756a85;
  line-height: 1.5;
}

.toolbar {
  gap: 9px;
  margin-top: 18px;
}

.today-entry-btn,
.new-entry-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  border-radius: 13px;
  font-weight: 650;
}

.today-entry-btn {
  border: 1px solid #7650d5;
  color: #fff;
  background: linear-gradient(145deg, #9368f2, #7d55dc);
  box-shadow: 0 10px 22px rgba(112, 72, 196, 0.2);
}

.today-entry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 26px rgba(112, 72, 196, 0.26);
}

.new-entry-btn {
  border: 1px solid #e1d5ef;
  color: #5f4e70;
  background: #fff;
  box-shadow: none;
}

.new-entry-btn:hover {
  border-color: #cbb5e7;
  background: #fbf8ff;
}

.search-field {
  position: relative;
  display: block;
}

.search-field > i {
  position: absolute;
  top: 50%;
  left: 13px;
  color: #94889e;
  transform: translateY(-50%);
}

.search-field .search-input {
  padding-left: 38px;
  border-radius: 12px;
  background: rgba(250, 248, 252, 0.92);
}

.utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.utility-actions .ghost-btn {
  padding: 6px 8px;
  border: 0;
  color: #8c8197;
  background: transparent;
  font-size: 12px;
}

.timeline-heading {
  margin: 20px 4px 9px;
}

.entry-list {
  min-height: 0;
  padding-right: 4px;
  overflow-y: auto;
}

.entry-day-group + .entry-day-group {
  margin-top: 14px;
}

.entry-group-label {
  margin: 0 7px 6px;
  color: #9a8fa4;
  font-size: 11px;
}

.entry-card {
  margin-bottom: 6px;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  box-shadow: none;
  background: transparent;
}

.entry-card:hover {
  border-color: #ebe2f4;
  background: rgba(255, 255, 255, 0.74);
  transform: none;
}

.entry-card.active {
  border-color: #dcccf0;
  background: #f7f1ff;
  box-shadow: inset 3px 0 0 #8b5cf6;
}

.entry-card-top {
  align-items: baseline;
}

.entry-title {
  font-size: 14px;
}

.entry-date {
  flex: 0 0 auto;
  font-size: 10px;
}

.entry-meta {
  margin-top: 7px;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  font-size: 10px;
}

.entry-snippet {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.45;
}

.main {
  min-height: calc(100vh - 110px);
  padding: clamp(34px, 5vw, 70px) clamp(28px, 7vw, 96px) 34px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.965), rgba(255, 255, 255, 0.965)),
    repeating-linear-gradient(0deg, transparent, transparent 35px, #eee9f3 36px);
}

.main-head {
  align-items: flex-start;
  margin-bottom: 28px;
}

.entry-day-label {
  margin-bottom: 9px;
  color: #8b5cf6;
}

.head-meta {
  gap: 8px;
}

.meta-pill {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.action-row .ghost-btn,
.action-row .danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
}

.page-title {
  min-height: auto;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #342b3d;
  background: transparent;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.045em;
  box-shadow: none;
}

.page-title::placeholder {
  color: #c4b9cc;
}

.section {
  margin-top: 30px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: #71657e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mood-section {
  margin-top: 12px;
}

.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: transparent;
  color: #73667f;
  background: transparent;
}

.mood-chip:hover,
.mood-chip.active {
  border-color: #dcccf0;
  color: #6b46c1;
  background: #f5efff;
}

.writing-section {
  margin-top: 36px;
}

.diary-textarea {
  min-height: 330px;
  padding: 18px 0 28px;
  border: 0;
  border-top: 1px solid #ebe3f1;
  border-bottom: 1px solid #ebe3f1;
  border-radius: 0;
  color: #433849;
  background: transparent;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 19px;
  line-height: 1.95;
  box-shadow: none;
  resize: vertical;
}

.diary-textarea:focus {
  border-color: #d9cae7;
  box-shadow: none;
}

.writing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.prompt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  border: 0;
  color: #8b5cf6;
  background: transparent;
  cursor: pointer;
}

.prompt-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #e8def2;
  border-radius: 14px;
  background: #fbf8ff;
}

.prompt-panel[hidden] {
  display: none;
}

.prompt-intro {
  margin-bottom: 9px;
  color: #8b8094;
  font-size: 12px;
}

.prompt-chip {
  border-radius: 10px;
  font-size: 12px;
}

.seal-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(360px, 1.2fr);
  gap: 12px 28px;
  align-items: center;
  padding: 20px;
  border: 1px solid #e5d8f2;
  border-radius: 18px;
  background: linear-gradient(145deg, #fbf8ff, #f7f1ff);
}

.seal-copy p {
  max-width: 37ch;
  margin: 0;
  color: #7d7189;
  font-size: 12px;
  line-height: 1.55;
}

.mode-options {
  justify-content: flex-end;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 11px;
}

.mode-help {
  grid-column: 2;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: right;
}

.footer-note {
  margin-top: 18px;
  color: #918698;
  font-size: 11px;
  line-height: 1.55;
}

.counter {
  color: #988ca0;
  font-size: 12px;
}

@media (max-width: 980px) {
  .shell {
    width: min(760px, calc(100% - 28px));
    grid-template-columns: 1fr;
    padding-top: 76px;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
  }

  .entry-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 330px;
  }

  .entry-day-group {
    display: contents;
  }

  .entry-group-label {
    display: none;
  }

  .main {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .nav-back {
    top: 12px;
    left: 12px;
  }

  .status {
    top: 12px;
    right: 12px;
    max-width: 50vw;
  }

  .shell {
    width: calc(100% - 20px);
    padding-top: 68px;
  }

  .main,
  .sidebar {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .entry-list {
    grid-template-columns: 1fr;
  }

  .main-head {
    gap: 14px;
  }

  .page-title {
    font-size: 38px;
  }

  .diary-textarea {
    min-height: 290px;
    font-size: 17px;
  }

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

  .mode-options {
    justify-content: flex-start;
  }

  .mode-help {
    grid-column: 1;
    text-align: left;
  }
}
