:root {
  color-scheme: light dark;
  --bg: #f5f5f5;
  --fg: #1d1d1d;
  --muted: #666;
  --card: #fff;
  --accent: #0b63f6;
  --border: #ddd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

#entry-view {
  margin-top: 12px;
}

.plus-btn {
  font-size: 20px;
  line-height: 1;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
}

.menu-wrap {
  position: relative;
}

.hamburger-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
}

.menu-panel {
  position: absolute;
  right: 0;
  top: 44px;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--fg);
}

.menu-item.danger {
  color: #c52b2b;
}

.stack,
.stack-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

input,
select,
button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: white;
}

button.secondary {
  background: transparent;
  color: var(--fg);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
}

.doc-item {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: inherit;
}

.doc-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-item .chev {
  font-size: 20px;
  opacity: 0.7;
}

.doc-item.active {
  border-color: var(--accent);
}

.muted {
  color: var(--muted);
}

.error {
  color: #b30000;
}

.hidden {
  display: none !important;
}

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

.wysiwyg {
  min-height: 140px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--card);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.tag-remove-pill {
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  line-height: 1;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quill-wrap {
  display: grid;
  gap: 0;
  min-height: 260px;
}

.quill-wrap .ql-toolbar.ql-snow,
.quill-wrap .ql-container.ql-snow {
  border-color: var(--border);
}

.quill-wrap .ql-container {
  min-height: 200px;
  background: var(--card);
}

.detail-actions {
  margin-top: 4px;
}

.attachment-row {
  justify-content: space-between;
  align-items: center;
}

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