* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f1ea;
  color: #2c2823;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: none;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* header */

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 32px;
  background: #2f2924;
  color: #fffaf3;
}

.label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  opacity: 0.75;
}

.site-header h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0.04em;
}

.lead {
  margin: 10px 0 0;
  color: #dfd2c4;
  line-height: 1.7;
}

.auth-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 160px;
}

.auth-area button,
.back-link {
  padding: 10px 14px;
  border-radius: 999px;
  background: #fffaf3;
  color: #2f2924;
  font-weight: 700;
}

.user-info {
  margin: 0;
  font-size: 12px;
  color: #dfd2c4;
}

/* common */

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto;
}

.site-footer {
  padding: 24px;
  text-align: center;
  color: #8a7d70;
  font-size: 13px;
}

/* index */

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

.memo-card {
  display: block;
  padding: 22px;
  border-radius: 22px;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  box-shadow: 0 12px 30px rgba(54, 43, 32, 0.08);
}

.memo-card.active {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.memo-card.active:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(54, 43, 32, 0.14);
}

.memo-card.coming-soon {
  opacity: 0.65;
}

.card-icon {
  font-size: 28px;
}

.memo-card h2 {
  margin: 12px 0 8px;
  font-size: 22px;
}

.memo-card p {
  margin: 0;
  line-height: 1.7;
  color: #6f6255;
}

.status {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #efe3d4;
  color: #5a4b3d;
  font-size: 12px;
  font-weight: 700;
}

/* quick */

.quick-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
}

.folder-panel,
.memo-panel {
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(54, 43, 32, 0.08);
}

.folder-panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.small-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2f2924;
  color: #fffaf3;
  font-weight: 700;
}

.folder-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.folder-item {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f2eadf;
  color: #4b4037;
  text-align: left;
}

.folder-item.active {
  background: #2f2924;
  color: #fffaf3;
}

.memo-panel {
  padding: 18px;
}

.memo-toolbar {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 10px;
}

.memo-toolbar input,
.memo-toolbar select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  background: #fff;
  color: #2c2823;
}

.memo-toolbar button,
.editor-actions button {
  padding: 11px 16px;
  border-radius: 14px;
  background: #2f2924;
  color: #fffaf3;
  font-weight: 700;
}

.memo-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-top: 16px;
  min-height: 560px;
}

.memo-list-wrap {
  border-right: 1px solid #eadccc;
  padding-right: 16px;
}

.memo-list-wrap h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.memo-list {
  display: grid;
  gap: 8px;
}

.memo-item {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: #f2eadf;
  text-align: left;
}

.memo-item.active {
  background: #2f2924;
  color: #fffaf3;
}

.memo-title {
  margin: 0;
  font-weight: 800;
  line-height: 1.4;
}

.memo-preview {
  margin: 6px 0 0;
  font-size: 12px;
  color: #75685d;
  line-height: 1.5;
}

.memo-item.active .memo-preview {
  color: #dfd2c4;
}

.editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#memoEditor {
  width: 100%;
  min-height: 500px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #d8c8b6;
  border-radius: 18px;
  background: #fff;
  color: #2c2823;
  line-height: 1.8;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

#saveStatus {
  margin: 0 auto 0 0;
  color: #8a7d70;
  font-size: 13px;
}

.danger-btn {
  background: #8b3a35 !important;
}

/* mobile */

@media (max-width: 800px) {
  .site-header {
    flex-direction: column;
    padding: 24px 18px;
  }

  .auth-area {
    align-items: flex-start;
  }

  .site-header h1 {
    font-size: 28px;
  }

  .memo-grid,
  .quick-layout,
  .memo-body,
  .memo-toolbar {
    grid-template-columns: 1fr;
  }

  .memo-list-wrap {
    border-right: none;
    border-bottom: 1px solid #eadccc;
    padding-right: 0;
    padding-bottom: 16px;
  }

  #memoEditor {
    min-height: 360px;
  }
}

/* normal memo */

.normal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
}

.folder-actions {
  margin-top: 12px;
}

.folder-action-btn {
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  background: #efe3d4;
  color: #4b4037;
  font-weight: 700;
}

.normal-toolbar {
  grid-template-columns: 1fr 220px auto;
}

.normal-body {
  grid-template-columns: 280px 1fr;
}

.normal-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.title-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d8c8b6;
  border-radius: 16px;
  background: #fff;
  color: #2c2823;
  font-size: 18px;
  font-weight: 800;
}

.view-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  padding: 9px 14px;
  border-radius: 999px;
  background: #efe3d4;
  color: #4b4037;
  font-weight: 700;
}

.tab-btn.active {
  background: #2f2924;
  color: #fffaf3;
}

#normalBodyEditor {
  width: 100%;
  min-height: 460px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #d8c8b6;
  border-radius: 18px;
  background: #fff;
  color: #2c2823;
  line-height: 1.8;
}

.markdown-preview {
  min-height: 460px;
  padding: 18px;
  border: 1px solid #d8c8b6;
  border-radius: 18px;
  background: #fff;
  color: #2c2823;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin: 1em 0 0.4em;
  line-height: 1.4;
}

.markdown-preview h1 {
  font-size: 26px;
  border-bottom: 2px solid #eadccc;
  padding-bottom: 8px;
}

.markdown-preview h2 {
  font-size: 22px;
}

.markdown-preview h3 {
  font-size: 18px;
}

.markdown-preview p {
  margin: 0.7em 0;
}

.markdown-preview ul {
  padding-left: 1.4em;
}

.markdown-preview blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 4px solid #bda88f;
  background: #f6eee5;
  color: #5f5145;
  border-radius: 10px;
}

.markdown-preview code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #f2eadf;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-preview pre {
  padding: 14px;
  border-radius: 14px;
  background: #2f2924;
  color: #fffaf3;
  overflow-x: auto;
}

.markdown-preview pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.markdown-preview .check-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.folder-children {
  display: grid;
  gap: 6px;
  margin: 6px 0 0 16px;
}

.folder-item.child {
  font-size: 14px;
  background: #f7f0e8;
}

.folder-item.child.active {
  background: #2f2924;
  color: #fffaf3;
}

@media (max-width: 800px) {
  .normal-layout,
  .normal-body,
  .normal-toolbar {
    grid-template-columns: 1fr;
  }

  #normalBodyEditor,
  .markdown-preview {
    min-height: 360px;
  }
}

/* task */

.task-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.task-form-panel,
.task-list-panel {
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(54, 43, 32, 0.08);
}

.task-form-panel {
  padding: 18px;
}

.task-form-panel h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.task-form-panel input,
.task-form-panel textarea,
.task-toolbar input,
.task-toolbar select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  background: #fff;
  color: #2c2823;
}

.task-form-panel textarea {
  min-height: 140px;
  resize: vertical;
  margin-top: 10px;
  line-height: 1.7;
}

.task-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

#addTaskBtn {
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #2f2924;
  color: #fffaf3;
  font-weight: 800;
}

#taskStatusText {
  margin: 12px 0 0;
  color: #8a7d70;
  font-size: 13px;
}

.task-list-panel {
  padding: 18px;
}

.task-toolbar {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 10px;
  margin-bottom: 16px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: #f2eadf;
  border: 1px solid #e6d9c9;
}

.task-check {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: #2f2924;
}

.task-main {
  min-width: 0;
}

.task-title {
  margin: 0;
  font-weight: 900;
  line-height: 1.5;
}

.task-title.done {
  text-decoration: line-through;
  color: #8a7d70;
}

.task-memo {
  margin: 6px 0 0;
  color: #6f6255;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.task-badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fffaf3;
  color: #5a4b3d;
  font-size: 12px;
  font-weight: 700;
}

.task-delete-btn {
  padding: 8px 10px;
  border-radius: 12px;
  background: #8b3a35;
  color: #fffaf3;
  font-weight: 800;
}

.empty-text {
  margin: 0;
  color: #8a7d70;
  line-height: 1.7;
}

@media (max-width: 800px) {
  .task-layout,
  .task-toolbar {
    grid-template-columns: 1fr;
  }

  .task-item {
    grid-template-columns: auto 1fr;
  }

  .task-delete-btn {
    grid-column: 2;
    justify-self: start;
  }
}

/* chat memo */

.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.chat-side-panel,
.chat-main-panel {
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(54, 43, 32, 0.08);
}

.chat-side-panel {
  padding: 18px;
}

.chat-room-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.chat-room-item {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: #f2eadf;
  color: #4b4037;
  text-align: left;
}

.chat-room-item.active {
  background: #2f2924;
  color: #fffaf3;
}

.chat-main-panel {
  padding: 18px;
  min-width: 0;
}

.chat-room-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid #eadccc;
}

.chat-room-head h2 {
  margin: 0;
  font-size: 24px;
}

.chat-room-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-room-actions select {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  background: #fff;
}

.chat-room-actions button,
.chat-input-area button {
  padding: 10px 14px;
  border-radius: 14px;
  background: #2f2924;
  color: #fffaf3;
  font-weight: 800;
}

.speaker-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: #f6eee5;
}

.speaker-box h3 {
  margin: 0;
  font-size: 17px;
}

.speaker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.speaker-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  color: #4b4037;
  font-weight: 700;
  font-size: 13px;
}

.speaker-chip.main {
  background: #2f2924;
  color: #fffaf3;
}

.speaker-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #efe3d4;
  font-size: 14px;
}

.speaker-chip.main .speaker-icon {
  background: #fffaf3;
  color: #2f2924;
}

.chat-messages {
  display: grid;
  gap: 14px;
  min-height: 440px;
  max-height: 580px;
  overflow-y: auto;
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.72), transparent 32%),
    #efe7dc;
}

.chat-message {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 78%;
}

.chat-message.left {
  justify-self: start;
}

.chat-message.right {
  justify-self: end;
  flex-direction: row-reverse;
}

.chat-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  font-size: 20px;
}

.chat-bubble-wrap {
  min-width: 0;
}

.chat-speaker-name {
  margin: 0 0 4px;
  font-size: 12px;
  color: #776a5d;
}

.chat-message.right .chat-speaker-name {
  text-align: right;
}

.chat-bubble {
  padding: 11px 13px;
  border-radius: 18px;
  background: #fffaf3;
  color: #2c2823;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message.right .chat-bubble {
  background: #2f2924;
  color: #fffaf3;
}

.chat-input-area {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.chat-input-area select,
.chat-input-area textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  background: #fff;
  color: #2c2823;
}

.chat-input-area textarea {
  min-height: 54px;
  max-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

@media (max-width: 800px) {
  .chat-layout,
  .chat-input-area {
    grid-template-columns: 1fr;
  }

  .chat-room-head {
    flex-direction: column;
  }

  .chat-room-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .chat-room-actions select {
    min-width: 0;
    width: 100%;
  }

  .chat-message {
    max-width: 92%;
  }
}


.chat-message.right .chat-bubble {
  background: #e8f3e3;
  color: #2c2823;
  border: 1px solid #c9ddc0;
}

.chat-message.right .chat-avatar {
  background: #e8f3e3;
  border-color: #c9ddc0;
}

.chat-message.right .chat-speaker-name {
  color: #566b4e;
}
.chat-avatar {
  margin-top: 18px;
}

.speaker-chip {
  cursor: pointer;
}

.chat-bubble {
  cursor: pointer;
}

.chat-message-actions {
  margin-top: 4px;
}

.chat-message.right .chat-message-actions {
  text-align: right;
}

.chat-message-actions button {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.8);
  color: #6f6255;
  font-size: 11px;
  font-weight: 700;
}

.chat-message-actions button:hover {
  background: #8b3a35;
  color: #fffaf3;
}

/* chat action menu */

.chat-bubble {
  cursor: default;
}

.chat-message-actions {
  position: relative;
  margin-top: 4px;
  display: flex;
  justify-content: flex-start;
}

.chat-message.right .chat-message-actions {
  justify-content: flex-end;
}

.chat-menu-btn {
  width: 26px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.75);
  color: #7d7065;
  font-size: 16px;
  line-height: 1;
}

.chat-menu-btn:hover {
  background: #fffaf3;
}

.chat-action-menu {
  position: absolute;
  top: 26px;
  z-index: 5;
  display: grid;
  gap: 4px;
  min-width: 88px;
  padding: 6px;
  border-radius: 12px;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  box-shadow: 0 10px 24px rgba(54, 43, 32, 0.14);
}

.chat-message.left .chat-action-menu {
  left: 0;
}

.chat-message.right .chat-action-menu {
  right: 0;
}

.chat-action-menu button {
  width: 100%;
  padding: 7px 9px;
  border-radius: 9px;
  background: transparent;
  color: #4b4037;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.chat-action-menu button:hover {
  background: #f2eadf;
}

.chat-action-menu .danger-menu-btn {
  color: #8b3a35;
}

/* edit modal */

.edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(47, 41, 36, 0.45);
}

.edit-box {
  width: min(560px, 100%);
  padding: 18px;
  border-radius: 22px;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.edit-box h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.edit-box textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #d8c8b6;
  border-radius: 16px;
  background: #fff;
  color: #2c2823;
  line-height: 1.7;
}

.edit-box-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.edit-box-actions button {
  padding: 10px 14px;
  border-radius: 14px;
  background: #efe3d4;
  color: #4b4037;
  font-weight: 800;
}

.edit-box-actions button:last-child {
  background: #2f2924;
  color: #fffaf3;
}

/* speaker edit */

.speaker-edit-input {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  background: #fff;
  color: #2c2823;
}

.icon-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 12px;
  border-radius: 16px;
  background: #f6eee5;
}

.icon-choice {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  font-size: 20px;
}

.icon-choice.active {
  background: #2f2924;
  color: #fffaf3;
  border-color: #2f2924;
}

/* chat folders */

.chat-room-title-row {
  margin-top: 22px;
}

.room-folder-select {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  background: #fff;
  color: #2c2823;
}

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

.room-edit-btn {
  padding: 6px 10px;
  border-radius: 999px;
  background: #efe3d4;
  color: #4b4037;
  font-size: 12px;
  font-weight: 800;
}

.room-edit-btn:hover {
  background: #2f2924;
  color: #fffaf3;
}

/* diary */

.diary-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.diary-calendar-panel,
.diary-editor-panel {
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(54, 43, 32, 0.08);
}

.diary-calendar-panel {
  padding: 18px;
}

.diary-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.diary-month-head h2 {
  margin: 0;
  font-size: 22px;
}

.diary-month-head button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2f2924;
  color: #fffaf3;
  font-size: 24px;
  font-weight: 800;
}

.week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  color: #8a7d70;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day {
  position: relative;
  min-height: 46px;
  padding: 7px 6px;
  border-radius: 14px;
  background: #f6eee5;
  color: #4b4037;
  text-align: left;
  font-weight: 800;
}

.calendar-day.empty {
  background: transparent;
  pointer-events: none;
}

.calendar-day.today {
  outline: 2px solid #d8b46a;
}

.calendar-day.selected {
  background: #2f2924;
  color: #fffaf3;
}

.calendar-day.has-diary::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d8b46a;
}

.calendar-day.selected.has-diary::after {
  background: #fff2c7;
}

.diary-editor-panel {
  padding: 18px;
  min-width: 0;
}

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

.diary-editor-head h2 {
  margin: 0;
  font-size: 24px;
}

#moodSelect {
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  background: #fff;
  color: #2c2823;
}

#diaryBody {
  width: 100%;
  min-height: 440px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #d8c8b6;
  border-radius: 18px;
  background: #fff;
  color: #2c2823;
  line-height: 1.8;
}

@media (max-width: 800px) {
  .diary-layout {
    grid-template-columns: 1fr;
  }

  .diary-editor-head {
    flex-direction: column;
  }

  #moodSelect {
    width: 100%;
  }

  #diaryBody {
    min-height: 340px;
  }
}

/* dream diary */

.dream-page {
  background:
    radial-gradient(circle at top left, rgba(190, 165, 255, 0.28), transparent 32%),
    radial-gradient(circle at bottom right, rgba(120, 95, 180, 0.22), transparent 34%),
    #f4f0ff;
  color: #29233a;
}

.dream-header {
  background:
    radial-gradient(circle at top right, rgba(190, 165, 255, 0.22), transparent 30%),
    #272038;
  color: #fffaff;
}

.dream-header .lead,
.dream-header .user-info {
  color: #d8cdec;
}

.dream-header .auth-area button,
.dream-header .back-link {
  background: #fffaff;
  color: #272038;
}

.dream-panel {
  background: rgba(255, 250, 255, 0.88);
  border-color: #dacff0;
  box-shadow: 0 14px 34px rgba(61, 45, 96, 0.12);
}

.dream-page .diary-month-head button {
  background: #3b2f58;
  color: #fffaff;
}

.dream-page .week-row {
  color: #84749f;
}

.dream-calendar .calendar-day {
  background: #eee7fb;
  color: #3b3154;
}

.dream-calendar .calendar-day.empty {
  background: transparent;
}

.dream-calendar .calendar-day.today {
  outline: 2px solid #a98df0;
}

.dream-calendar .calendar-day.selected {
  background: #3b2f58;
  color: #fffaff;
}

.dream-calendar .calendar-day.has-diary::after {
  background: #9f7cff;
}

.dream-calendar .calendar-day.selected.has-diary::after {
  background: #f5e8ff;
}

#dreamMoodSelect {
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid #d8c8e8;
  border-radius: 14px;
  background: #fff;
  color: #29233a;
}

#dreamBody {
  width: 100%;
  min-height: 440px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #d8c8e8;
  border-radius: 18px;
  background: #fff;
  color: #29233a;
  line-height: 1.8;
}

.dream-page .editor-actions button:last-child {
  background: #3b2f58;
  color: #fffaff;
}

.dream-page .danger-btn {
  background: #7d3f68 !important;
}

@media (max-width: 800px) {
  #dreamMoodSelect {
    width: 100%;
  }

  #dreamBody {
    min-height: 340px;
  }
}


.diary-month-head {
  display: grid;
  grid-template-columns: 38px 38px 1fr 38px 38px;
  align-items: center;
}

.diary-month-head h2 {
  text-align: center;
}

/* music memo */

.music-page {
  background:
    radial-gradient(circle at top left, rgba(255, 214, 145, 0.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(88, 72, 56, 0.16), transparent 34%),
    #f4efe6;
  color: #29231f;
}

.music-header {
  background:
    radial-gradient(circle at top right, rgba(255, 214, 145, 0.18), transparent 32%),
    #211c18;
  color: #fffaf3;
}

.music-header .lead,
.music-header .user-info {
  color: #e7d7c3;
}

.music-header .auth-area button,
.music-header .back-link {
  background: #fffaf3;
  color: #211c18;
}

.music-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.music-form-panel,
.music-list-panel {
  background: rgba(255, 250, 243, 0.92);
  border: 1px solid #e0d0bc;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(45, 34, 24, 0.1);
}

.music-form-panel {
  padding: 18px;
}

.music-form-head {
  margin-bottom: 14px;
}

.music-form-head h2 {
  margin: 0;
  font-size: 22px;
}

.music-form-panel input,
.music-form-panel textarea,
.music-toolbar input,
.music-toolbar select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d9c7b0;
  border-radius: 14px;
  background: #fff;
  color: #29231f;
}

.music-form-panel input + input,
.music-form-panel input + textarea,
.music-form-panel textarea + textarea {
  margin-top: 10px;
}

#musicLyricsInput,
#musicTranslationInput {
  min-height: 160px;
  resize: vertical;
  line-height: 1.7;
}

.music-list-panel {
  padding: 18px;
  min-width: 0;
}

.music-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  margin-bottom: 16px;
}

.music-list {
  display: grid;
  gap: 12px;
}

.music-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, #fffaf3, #f1e6d7);
  border: 1px solid #e0d0bc;
  text-align: left;
  box-shadow: 0 8px 22px rgba(45, 34, 24, 0.07);
}

.music-card.active {
  outline: 2px solid #2f2924;
}

.music-disc {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #f8e1a8 0 13%, #2f2924 14% 42%, #5a4b3d 43% 56%, #2f2924 57%);
  color: #fffaf3;
  font-size: 16px;
}

.music-card-main {
  min-width: 0;
}

.music-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.4;
}

.music-meta {
  margin: 5px 0 0;
  color: #6f6255;
  font-size: 13px;
  line-height: 1.5;
}

.music-preview {
  margin: 8px 0 0;
  color: #8a7d70;
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-link {
  display: inline-block;
  margin-top: 9px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #2f2924;
  color: #fffaf3;
  font-size: 12px;
  font-weight: 800;
}

.music-page .editor-actions button:last-child {
  background: #211c18;
  color: #fffaf3;
}

.music-page .danger-btn {
  background: #8b3a35 !important;
}

@media (max-width: 900px) {
  .music-layout,
  .music-toolbar {
    grid-template-columns: 1fr;
  }

  .music-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .music-disc {
    width: 46px;
    height: 46px;
  }
}

/* story archive */

.story-page {
  background:
    radial-gradient(circle at top left, rgba(185, 140, 90, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(92, 68, 48, 0.14), transparent 34%),
    #f3eee5;
  color: #2d2620;
}

.story-header {
  background:
    radial-gradient(circle at top right, rgba(232, 192, 142, 0.18), transparent 32%),
    #30261f;
  color: #fffaf3;
}

.story-header .lead,
.story-header .user-info {
  color: #e5d4c0;
}

.story-header .auth-area button,
.story-header .back-link {
  background: #fffaf3;
  color: #30261f;
}

.story-layout {
  display: grid;
  grid-template-columns: 230px 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.story-work-panel,
.story-episode-panel,
.story-editor-panel {
  background: rgba(255, 250, 243, 0.94);
  border: 1px solid #e2d1bd;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(49, 36, 24, 0.09);
}

.story-work-panel,
.story-episode-panel {
  padding: 18px;
}

.story-editor-panel {
  padding: 18px;
  min-width: 0;
}

.story-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.story-item {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  background: #f2e8dc;
  color: #4d3f34;
  text-align: left;
}

.story-item.active {
  background: #30261f;
  color: #fffaf3;
}

.story-item-title {
  margin: 0;
  font-weight: 900;
  line-height: 1.4;
}

.story-item-sub {
  margin: 5px 0 0;
  color: #7d6d5e;
  font-size: 12px;
  line-height: 1.4;
}

.story-item.active .story-item-sub {
  color: #e5d4c0;
}

.story-subtext {
  margin: 10px 0 0;
  color: #8a7d70;
  font-size: 13px;
  line-height: 1.6;
}

.story-editor-head {
  margin-bottom: 14px;
}

.story-editor-head h2 {
  margin: 0;
  font-size: 24px;
}

.story-editor-panel input,
.story-editor-panel textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8c7b3;
  border-radius: 14px;
  background: #fff;
  color: #2d2620;
}

.story-editor-panel input + input,
.story-editor-panel input + textarea {
  margin-top: 10px;
}

#episodeBodyInput {
  min-height: 520px;
  resize: vertical;
  line-height: 1.9;
}

.story-page .editor-actions button:last-child {
  background: #30261f;
  color: #fffaf3;
}

.story-page .danger-btn {
  background: #8b3a35 !important;
}

@media (max-width: 1000px) {
  .story-layout {
    grid-template-columns: 1fr;
  }

  #episodeBodyInput {
    min-height: 380px;
  }
}

/* people note */

.people-page {
  background:
    radial-gradient(circle at top left, rgba(180, 215, 255, 0.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 205, 225, 0.2), transparent 34%),
    #f4f7fb;
  color: #26303a;
}

.people-header {
  background:
    radial-gradient(circle at top right, rgba(180, 215, 255, 0.2), transparent 32%),
    #253142;
  color: #f8fbff;
}

.people-header .lead,
.people-header .user-info {
  color: #d5dfeb;
}

.people-header .auth-area button,
.people-header .back-link {
  background: #f8fbff;
  color: #253142;
}

.people-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.people-list-panel,
.people-editor-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d7e1ec;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(35, 49, 66, 0.09);
}

.people-list-panel {
  padding: 18px;
}

.people-editor-panel {
  padding: 18px;
  min-width: 0;
}

.people-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  margin-bottom: 16px;
}

.people-toolbar input,
.people-toolbar select,
.people-form-grid input,
.people-form-grid select,
.people-editor-panel textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cdd9e6;
  border-radius: 14px;
  background: #fff;
  color: #26303a;
}

.people-list {
  display: grid;
  gap: 10px;
}

.person-card {
  width: 100%;
  padding: 14px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, #ffffff, #eef5fb);
  border: 1px solid #d7e1ec;
  text-align: left;
  box-shadow: 0 8px 22px rgba(35, 49, 66, 0.06);
}

.person-card.active {
  outline: 2px solid #253142;
}

.person-name {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.4;
}

.person-sub {
  margin: 5px 0 0;
  color: #647386;
  font-size: 13px;
  line-height: 1.5;
}

.person-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.person-badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e5eef8;
  color: #42566d;
  font-size: 12px;
  font-weight: 800;
}

.people-editor-head {
  margin-bottom: 14px;
}

.people-editor-head h2 {
  margin: 0;
  font-size: 24px;
}

.people-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.people-form-grid input:nth-child(7) {
  grid-column: 1 / -1;
}

.people-editor-panel textarea {
  margin-top: 10px;
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

#personMemoInput {
  min-height: 160px;
}

#personPropsInput {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.people-page .editor-actions button:last-child {
  background: #253142;
  color: #f8fbff;
}

.people-page .danger-btn {
  background: #8b3a35 !important;
}

@media (max-width: 900px) {
  .people-layout,
  .people-toolbar,
  .people-form-grid {
    grid-template-columns: 1fr;
  }

  .people-form-grid input:nth-child(7) {
    grid-column: auto;
  }
}

/* home */

.home-page {
  min-height: 100vh;
  background: #f5f1ea;
  color: #2c2823;
}

.home-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 32px;
  background: #2f2924;
  color: #fffaf3;
}

.home-header h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0.04em;
}

.home-header .lead {
  color: #dfd2c4;
}

.home-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 160px;
}

.home-header-actions .ghost-link,
.home-header-actions .small-btn {
  width: auto;
  height: auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fffaf3;
  color: #2f2924;
  font-weight: 700;
}

.home-main {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto;
}

.home-user-card,
.home-section,
.home-section-card {
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(54, 43, 32, 0.08);
}

.home-user-card {
  padding: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.home-user-card h2 {
  margin: 4px 0;
  font-size: 22px;
}

.home-user-card p {
  margin: 0;
  color: #6f6255;
  line-height: 1.7;
}

.primary-btn {
  padding: 10px 14px;
  border-radius: 999px;
  background: #2f2924;
  color: #fffaf3;
  font-weight: 700;
}

.home-content {
  display: grid;
  gap: 18px;
}

.home-section {
  padding: 22px;
}

.home-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.home-section-head h2 {
  margin: 0;
  font-size: 22px;
}

.home-section-head.mini {
  margin-bottom: 12px;
}

.home-section-head.mini h2 {
  font-size: 18px;
}

.home-section-head.mini a {
  padding: 6px 10px;
  border-radius: 999px;
  background: #efe3d4;
  color: #5a4b3d;
  font-size: 12px;
  font-weight: 700;
}

.page-label,
.section-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: inherit;
  opacity: 0.75;
}

.recent-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.timeline-card {
  display: block;
  min-height: 140px;
  padding: 16px;
  border-radius: 18px;
  background: #f2eadf;
  border: 1px solid #e6d9c9;
  color: #2c2823;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(54, 43, 32, 0.14);
}

.timeline-label {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fffaf3;
  color: #5a4b3d;
  font-size: 12px;
  font-weight: 700;
}

.timeline-card h3 {
  margin: 12px 0 8px;
  font-size: 17px;
  line-height: 1.5;
}

.timeline-card p {
  margin: 0 0 10px;
  color: #6f6255;
  font-size: 13px;
  line-height: 1.7;
}

.timeline-card small,
.home-list-item small {
  color: #8a7d70;
  font-size: 12px;
}

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

.home-section-card {
  padding: 18px;
}

.home-list {
  display: grid;
  gap: 8px;
}

.home-list-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 14px;
  background: #f2eadf;
  border: 1px solid #e6d9c9;
  color: #2c2823;
}

.home-list-item:hover {
  background: #efe3d4;
}

.home-list-item strong {
  font-size: 15px;
  line-height: 1.5;
}

.home-list-item span {
  color: #6f6255;
  font-size: 13px;
  line-height: 1.6;
}

.empty-text {
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  background: #f2eadf;
  color: #8a7d70;
  line-height: 1.7;
}

/* mobile */

@media (max-width: 800px) {
  .home-header {
    flex-direction: column;
    padding: 24px 18px;
  }

  .home-header h1 {
    font-size: 28px;
  }

  .home-header-actions {
    align-items: flex-start;
  }

  .home-user-card,
  .home-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .recent-timeline,
  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* shared list */

.shared-list-panel {
  padding: 18px;
  border-radius: 22px;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  box-shadow: 0 12px 30px rgba(54, 43, 32, 0.08);
}

.shared-memo-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.shared-list-card {
  padding: 16px;
  border-radius: 18px;
  background: #f2eadf;
  border: 1px solid #e6d9c9;
}

.shared-list-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.shared-list-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.5;
}

.shared-list-card small {
  color: #8a7d70;
  font-size: 12px;
}

.shared-list-preview {
  margin: 12px 0;
  color: #6f6255;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.shared-list-actions a,
.shared-list-actions button {
  padding: 8px 10px;
  border-radius: 12px;
  background: #fffaf3;
  color: #4b4037;
  font-size: 12px;
  font-weight: 800;
}

.shared-list-actions .danger-btn {
  background: #8b3a35;
  color: #fffaf3;
}

.shared-url-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  background: #fffaf3;
  color: #6f6255;
  font-size: 13px;
}

@media (max-width: 800px) {
  .shared-list-card-head {
    flex-direction: column;
  }

  .shared-list-actions {
    justify-content: flex-start;
  }
}

.memo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.memo-card.home-card {
  background: #fff4df;
  border-color: #e4c991;
}

.memo-card.home-card .status {
  background: #e6c982;
  color: #3f3425;
}

.memo-card.share-card {
  background: #eef4ff;
  border-color: #b9cbe8;
}

.memo-card.share-card .status {
  background: #cad9f0;
  color: #253142;
}

.memo-card.home-card.active:hover {
  box-shadow: 0 16px 34px rgba(150, 112, 48, 0.16);
}

.memo-card.share-card.active:hover {
  box-shadow: 0 16px 34px rgba(65, 92, 135, 0.16);
}

/* landing */

.landing-page {
  min-height: 100vh;
  background: #f5f1ea;
  color: #2c2823;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 32px;
  background: rgba(245, 241, 234, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e6d9c9;
}

.landing-logo {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #2f2924;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
}

.landing-nav a {
  color: #5a4b3d;
}

.landing-nav .nav-button {
  padding: 9px 13px;
  border-radius: 999px;
  background: #2f2924;
  color: #fffaf3;
}

.landing-hero {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 70px 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 420px;
  gap: 36px;
  align-items: center;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.15;
  letter-spacing: 0.03em;
}

.hero-lead {
  max-width: 620px;
  margin: 22px 0 0;
  color: #6f6255;
  line-height: 1.9;
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-primary,
.hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 900;
}

.hero-primary {
  background: #2f2924;
  color: #fffaf3;
}

.hero-secondary {
  background: #fffaf3;
  color: #2f2924;
  border: 1px solid #e6d9c9;
}

.hero-note {
  margin: 14px 0 0;
  color: #8a7d70;
  font-size: 13px;
}

.hero-card {
  min-width: 0;
}

.notebook-card {
  position: relative;
  padding: 26px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, #fffaf3, #f3eadf);
  border: 1px solid #e6d9c9;
  box-shadow: 0 24px 50px rgba(54, 43, 32, 0.14);
  transform: rotate(1.5deg);
}

.notebook-card::before {
  content: "";
  position: absolute;
  inset: 16px auto 16px -10px;
  width: 18px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      to bottom,
      #2f2924 0 10px,
      transparent 10px 22px
    );
  opacity: 0.22;
}

.notebook-top {
  display: flex;
  gap: 8px;
  margin-bottom: 26px;
}

.notebook-top span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d8c8b6;
}

.notebook-card h2 {
  margin: 0;
  font-size: 44px;
  letter-spacing: 0.04em;
}

.notebook-card > p {
  margin: 8px 0 22px;
  color: #6f6255;
  font-weight: 700;
}

.mini-note-list {
  display: grid;
  gap: 10px;
}

.mini-note-list div {
  padding: 13px 14px;
  border-radius: 16px;
  background: #f2eadf;
  border: 1px solid #e6d9c9;
}

.mini-note-list strong {
  display: block;
  margin-bottom: 4px;
}

.mini-note-list span {
  color: #6f6255;
  font-size: 13px;
}

.landing-section {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 42px;
  padding: 34px;
  border-radius: 28px;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  box-shadow: 0 12px 30px rgba(54, 43, 32, 0.08);
}

.section-title {
  max-width: 680px;
  margin-bottom: 22px;
}

.section-title h2,
.split-section h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0.03em;
}

.section-title p,
.split-section p,
.private-box p {
  color: #6f6255;
  line-height: 1.8;
}

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

.feature-card {
  display: block;
  padding: 18px;
  border-radius: 20px;
  background: #f2eadf;
  border: 1px solid #e6d9c9;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(54, 43, 32, 0.12);
}

.feature-card span {
  font-size: 28px;
}

.feature-card h3 {
  margin: 12px 0 8px;
  font-size: 18px;
}

.feature-card p {
  margin: 0;
  color: #6f6255;
  line-height: 1.7;
  font-size: 14px;
}

.feature-card.accent-home {
  background: #fff4df;
  border-color: #e4c991;
}

.feature-card.accent-share {
  background: #eef4ff;
  border-color: #b9cbe8;
}

.feature-card.admin-feature {
  opacity: 0.86;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: center;
}

.private-box {
  padding: 20px;
  border-radius: 22px;
  background: #f2eadf;
  border: 1px solid #e6d9c9;
}

.private-box h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.landing-footer {
  padding: 28px 18px 40px;
  text-align: center;
  color: #8a7d70;
  font-size: 13px;
}

.landing-footer p {
  margin: 4px 0;
}

/* landing mobile */

@media (max-width: 1000px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .hero-card {
    max-width: 520px;
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .landing-header {
    position: static;
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-nav {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .landing-nav a {
    padding: 10px 12px;
    border-radius: 14px;
    background: #fffaf3;
    border: 1px solid #e6d9c9;
    text-align: center;
  }

  .landing-nav .nav-button {
    background: #2f2924;
    color: #fffaf3;
  }

  .landing-hero {
    width: min(100% - 32px, 1100px);
    padding: 38px 0 28px;
    gap: 24px;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-actions {
    display: grid;
  }

  .notebook-card {
    padding: 22px;
    transform: none;
  }

  .notebook-card h2 {
    font-size: 36px;
  }

  .landing-section {
    width: min(100% - 32px, 1100px);
    padding: 22px;
    border-radius: 22px;
  }

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

/* landing card size fix */

.feature-card,
.feature-card.accent-home,
.feature-card.accent-share {
  grid-column: auto;
}

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

@media (min-width: 1100px) {
  .feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

.locked-feature {
  cursor: default;
  opacity: 0.72;
}

.locked-feature:hover {
  transform: none;
  box-shadow: none;
}

.locked-feature small {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #efe3d4;
  color: #5a4b3d;
  font-size: 12px;
  font-weight: 800;
}

.error-hero {
  min-height: calc(100vh - 180px);
}

.memo-image-block {
  margin: 18px 0;
  padding: 12px;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 16px;
}

.memo-image-block img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
  background: #f2eadf;
}

.memo-image-block figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #7d7063;
  text-align: center;
}

.memo-inline-image {
  display: inline-block;
  vertical-align: middle;
}

.memo-inline-image img {
  max-width: 180px;
  max-height: 120px;
  border-radius: 10px;
  object-fit: contain;
}

.memo-image-block {
  margin: 18px 0;
  padding: 12px;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 16px;
}

.memo-image-block img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
  background: #f2eadf;
}

.memo-image-block figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #7d7063;
  text-align: center;
}

.image-error {
  padding: 10px 12px;
  background: #fff0f0;
  border: 1px solid #f1c2c2;
  color: #9b3b3b;
  border-radius: 12px;
}

/* normal memo layout fix */

.normal-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.normal-layout .folder-panel {
  width: 100%;
}

.normal-layout .memo-panel {
  width: 100%;
}

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

.normal-body .memo-list-wrap {
  min-width: 0;
}

.normal-editor-wrap {
  min-width: 0;
}

.normal-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 10px;
}

.editor-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.editor-actions p {
  min-width: 100%;
}

@media (max-width: 900px) {
  .normal-body {
    grid-template-columns: 1fr;
  }

  .normal-toolbar {
    grid-template-columns: 1fr;
  }

  .normal-toolbar input,
  .normal-toolbar select,
  .normal-toolbar button {
    width: 100%;
  }
}

/* account */

.account-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-card {
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 14px 30px rgba(47, 41, 36, 0.08);
}

.account-subtext {
  color: #7d7063;
  margin-top: 6px;
}

.account-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.account-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #2f2924;
  color: #fffaf3;
  font-size: 0.85rem;
  font-weight: 700;
}

.account-role-badge.user {
  background: #e9ddce;
  color: #3b3128;
}

.account-role-badge.admin {
  background: #5b3f8c;
  color: #fff;
}

.account-uid-text {
  color: #8b7c70;
  font-size: 0.8rem;
  word-break: break-all;
}

.account-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.usage-card {
  background: #f7efe5;
  border: 1px solid #e6d9c9;
  border-radius: 18px;
  padding: 16px;
}

.usage-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.usage-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.usage-limit {
  margin-top: 8px;
  color: #7d7063;
  font-size: 0.9rem;
}

.usage-bar {
  overflow: hidden;
  height: 8px;
  margin-top: 12px;
  background: #e6d9c9;
  border-radius: 999px;
}

.usage-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: #2f2924;
  border-radius: 999px;
}

.limit-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.limit-list div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  background: #f7efe5;
  border-radius: 14px;
}

.limit-list span {
  color: #7d7063;
  font-size: 0.9rem;
}

.account-note {
  margin-top: 14px;
  color: #7d7063;
  font-size: 0.9rem;
}

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

  .account-section-head {
    flex-direction: column;
  }
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .home-section-head {
    flex-direction: row;
    align-items: center;
  }

  .home-section-head .icon-btn {
    width: 42px;
    flex: 0 0 42px;
  }
}

.terms-layout {
  max-width: 900px;
}

.terms-card {
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 22px;
  padding: 28px;
  line-height: 1.9;
  box-shadow: 0 14px 30px rgba(47, 41, 36, 0.08);
}

.terms-card h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.terms-card h2:first-of-type {
  margin-top: 10px;
}

.terms-card p {
  margin: 0 0 12px;
}

.terms-card ul {
  margin: 10px 0 0;
  padding-left: 1.4em;
}

.terms-card li {
  margin-bottom: 6px;
}

.terms-date {
  color: #7d7063;
  font-size: 0.9rem;
}

/* common header */

.common-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  background: rgba(47, 41, 36, 0.94);
  color: #fffaf3;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 250, 243, 0.12);
}

.common-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.common-logo {
  color: #fffaf3;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.common-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.common-nav a {
  color: #fffaf3;
  text-decoration: none;
  font-size: 0.88rem;
  padding: 7px 10px;
  border-radius: 999px;
  opacity: 0.9;
}

.common-nav a:hover {
  background: rgba(255, 250, 243, 0.12);
  opacity: 1;
}

.menu-toggle-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 250, 243, 0.24);
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.08);
  color: #fffaf3;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 760px) {
  .common-header {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 16px;
  }

  .common-header-top {
    width: 100%;
  }

  .menu-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .common-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 8px;
  }

  .common-nav.open {
    display: flex;
  }

  .common-nav a {
    padding: 12px 14px;
    background: rgba(255, 250, 243, 0.08);
    border-radius: 14px;
  }
}

.planned-feature {
  opacity: 0.9;
  background: #f7efe5;
  border-style: dashed;
}

.planned-feature small,
.feature-card small {
  display: inline-flex;
  width: fit-content;
  margin-top: auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e6d9c9;
  color: #5f5145;
  font-size: 0.78rem;
  font-weight: 700;
}

.feature-card.accent-home small {
  background: #ecd39a;
  color: #4a3515;
}

.feature-card.accent-share small {
  background: #cddbf2;
  color: #30405b;
}

.small-actions {
  margin-top: 14px;
}

/* image memo */

.image-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.image-control-panel,
.image-list-panel {
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(47, 41, 36, 0.08);
}

.image-control-panel {
  position: sticky;
  top: 86px;
}

.image-input-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.image-tab {
  background: #f2eadf;
  color: #3b3128;
  border: 1px solid #e6d9c9;
}

.image-tab.active {
  background: #2f2924;
  color: #fffaf3;
}

.image-input-area {
  margin-bottom: 12px;
}

.image-upload-box {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 92px;
  border: 2px dashed #d9c9b7;
  border-radius: 18px;
  background: #f7efe5;
  cursor: pointer;
  text-align: center;
}

.image-upload-box span {
  font-weight: 800;
}

.image-upload-box small,
.image-help-text {
  color: #7d7063;
  font-size: 0.85rem;
}

.image-preview-box {
  display: grid;
  place-items: center;
  min-height: 210px;
  margin: 12px 0;
  background: #f2eadf;
  border: 1px solid #e6d9c9;
  border-radius: 18px;
  overflow: hidden;
  color: #8b7c70;
}

.image-preview-box img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.image-control-panel input[type="text"],
.image-control-panel input[type="url"],
.image-control-panel textarea,
.image-toolbar input,
.image-toolbar select {
  width: 100%;
}

.image-control-panel textarea {
  min-height: 130px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5f5145;
  font-size: 0.92rem;
}

.checkbox-line.compact {
  white-space: nowrap;
}

.image-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
  margin-top: 14px;
}

.image-memo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.image-memo-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 18px;
  cursor: pointer;
}

.image-memo-card.active {
  outline: 3px solid rgba(47, 41, 36, 0.18);
}

.image-memo-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f2eadf;
  overflow: hidden;
}

.image-memo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-memo-info {
  padding: 12px;
}

.image-memo-title {
  margin: 0;
  font-weight: 800;
  color: #2f2924;
}

.image-memo-sub {
  margin: 4px 0 0;
  color: #7d7063;
  font-size: 0.85rem;
}

.image-memo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.image-memo-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2eadf;
  color: #6b5a4b;
  font-size: 0.75rem;
  font-weight: 700;
}

@media (max-width: 1000px) {
  .image-layout {
    grid-template-columns: 1fr;
  }

  .image-control-panel {
    position: static;
  }

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

@media (max-width: 650px) {
  .image-toolbar {
    grid-template-columns: 1fr;
  }

  .image-memo-grid {
    grid-template-columns: 1fr;
  }
}

/* image memo layout fix */

.image-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.image-control-panel,
.image-list-panel {
  width: 100%;
  min-width: 0;
}

.image-control-panel {
  position: static;
}

.image-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.image-toolbar input,
.image-toolbar select,
.image-toolbar label {
  width: 100%;
}

.image-memo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-actions {
  flex-wrap: wrap;
}

.editor-actions p {
  width: 100%;
}

@media (max-width: 900px) {
  .image-memo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .image-memo-grid {
    grid-template-columns: 1fr;
  }
}



/* image memo square grid */

.image-memo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.image-memo-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  background: #fffaf3;
  border: 1px solid #e6d9c9;
  border-radius: 18px;
  cursor: pointer;
  min-width: 0;
}

.image-memo-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f2eadf;
  overflow: hidden;
}

.image-memo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-memo-info {
  padding: 10px;
  min-width: 0;
}

.image-memo-title {
  margin: 0;
  font-weight: 800;
  color: #2f2924;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.image-memo-sub {
  margin: 4px 0 0;
  color: #7d7063;
  font-size: 0.82rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.image-memo-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 8px;
  overflow: hidden;
}

.image-memo-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2eadf;
  color: #6b5a4b;
  font-size: 0.72rem;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .image-memo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .image-memo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .image-memo-grid {
    grid-template-columns: 1fr;
  }
}

/* image folders */

.image-folder-panel {
  margin-top: 14px;
  padding: 12px;
  background: #f7efe5;
  border: 1px solid #e6d9c9;
  border-radius: 18px;
}

.panel-head.mini {
  margin-bottom: 10px;
}

.panel-head.mini h3 {
  margin: 0;
  font-size: 1rem;
}

.image-folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-folder-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 11px;
  background: #fffaf3;
  color: #3b3128;
  border: 1px solid #e6d9c9;
  border-radius: 999px;
  cursor: pointer;
}

.image-folder-btn span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.image-folder-btn small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: #e6d9c9;
  color: #5f5145;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.image-folder-btn.active {
  background: #2f2924;
  color: #fffaf3;
  border-color: #2f2924;
}

.image-folder-btn.active small {
  background: rgba(255, 250, 243, 0.22);
  color: #fffaf3;
}

/* image memo layout emergency fix */

.image-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.image-control-panel,
.image-list-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.image-control-panel {
  position: static;
}

.image-control-panel .panel-head,
.image-list-panel .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.image-control-panel .panel-head > div,
.image-list-panel .panel-head > div {
  min-width: 0;
}

.image-control-panel .panel-head .small-btn,
.image-list-panel .panel-head .small-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.image-input-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.image-tab {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.image-preview-box {
  width: 100%;
  min-width: 0;
}

.image-control-panel input,
.image-control-panel textarea,
.image-toolbar input,
.image-toolbar select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.image-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px auto;
  gap: 10px;
  align-items: center;
}

.image-toolbar .checkbox-line {
  min-width: 0;
  white-space: nowrap;
}

.image-memo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.image-memo-thumb {
  aspect-ratio: 1 / 1;
}

.image-memo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.editor-actions p {
  width: 100%;
  margin-right: auto;
}

@media (max-width: 900px) {
  .image-toolbar {
    grid-template-columns: 1fr;
  }

  .image-toolbar .checkbox-line {
    width: 100%;
  }

  .image-memo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .image-memo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-actions button {
    flex: 1 1 auto;
  }
}

@media (max-width: 420px) {
  .image-memo-grid {
    grid-template-columns: 1fr;
  }
}
