:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #171717;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f5f7;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: #1f2937;
  color: #fff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button:hover {
  background: #111827;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ghost {
  background: #e5e7eb;
  color: #222;
}

.ghost:hover {
  background: #d8dce2;
}

.danger {
  background: #b42318;
}

.danger:hover {
  background: #8f1d14;
}

.is-hidden {
  display: none !important;
}

.eyebrow {
  color: #8a6a00;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.login-view {
  align-items: center;
  display: flex;
  min-height: 100vh;
  justify-content: center;
  padding: 24px;
}

.login-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  max-width: 380px;
  padding: 28px;
  width: 100%;
}

.login-panel h1,
.pane-heading h1 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}

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

label span {
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
}

input,
textarea {
  background: #fff;
  border: 1px solid #d8dde5;
  border-radius: 7px;
  color: #111827;
  outline: none;
  padding: 11px 12px;
  width: 100%;
}

input:focus,
textarea:focus {
  border-color: #d6a400;
  box-shadow: 0 0 0 3px rgba(214, 164, 0, 0.15);
}

.login-panel label {
  margin: 24px 0 16px;
}

.login-panel button {
  width: 100%;
}

.message {
  color: #b42318;
  font-size: 13px;
  min-height: 18px;
  margin: 14px 0 0;
}

.admin-app {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  min-height: 100vh;
}

.memo-list-pane {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pane-heading {
  align-items: center;
  border-bottom: 1px solid #edf0f4;
  display: flex;
  justify-content: space-between;
  padding: 22px;
}

.icon-button {
  align-items: center;
  background: #f2c94c;
  color: #1f2937;
  display: inline-flex;
  font-size: 24px;
  font-weight: 600;
  justify-content: center;
  min-width: 38px;
  padding: 0;
}

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

.memo-list {
  display: grid;
  gap: 2px;
  overflow: auto;
  padding: 10px;
}

.memo-row {
  background: transparent;
  border-radius: 7px;
  color: #111827;
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 70px;
  padding: 11px 12px;
  text-align: left;
}

.memo-row:hover,
.memo-row.is-active {
  background: #f3f4f6;
}

.memo-row strong {
  display: block;
  font-size: 15px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-row span {
  color: #6b7280;
  display: block;
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.toolbar {
  align-items: center;
  background: rgba(244, 245, 247, 0.92);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 70px;
  padding: 16px 22px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.toolbar-status {
  color: #4b5563;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.workspace {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(320px, 1fr) minmax(300px, 420px);
  padding: 24px;
}

.editor-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.body-label textarea {
  min-height: calc(100vh - 210px);
  resize: vertical;
}

.preview-pane {
  align-self: start;
  display: flex;
  justify-content: center;
  min-width: 0;
  position: sticky;
  top: 94px;
}

.iphone-note {
  background: #fffef8;
  border: 1px solid #ece7d7;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(31, 41, 55, 0.12);
  min-height: 620px;
  padding: 18px 20px 28px;
  width: min(100%, 390px);
}

.note-nav {
  align-items: center;
  color: #d39b00;
  display: flex;
  font-size: 15px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.iphone-note time {
  color: #8d8d92;
  display: block;
  font-size: 12px;
  margin-bottom: 12px;
  text-align: center;
}

.iphone-note h2 {
  color: #111;
  font-size: 28px;
  line-height: 1.18;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}

.note-body {
  color: #1f1f1f;
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
}

.note-body p {
  margin: 0 0 14px;
}

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

  .memo-list-pane {
    border-bottom: 1px solid #e2e8f0;
    border-right: 0;
    max-height: 300px;
  }

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

  .preview-pane {
    position: static;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .body-label textarea {
    min-height: 320px;
  }
}

@media (max-width: 520px) {
  .pane-heading,
  .toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .toolbar-actions button {
    flex: 1 1 calc(50% - 6px);
  }
}
