:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --fg: #172033;
  --muted: #62708a;
  --card: #ffffff;
  --accent: #315eea;
  --accent-light: #edf2ff;
  --accent-hover: #2448bd;
  --border: #dbe3f0;
  --danger: #ef4444;
  --shadow: 0 1px 2px rgba(21, 35, 62, 0.04), 0 8px 28px rgba(21, 35, 62, 0.07);
  --shadow-hover: 0 8px 18px rgba(21, 35, 62, 0.08), 0 20px 42px rgba(21, 35, 62, 0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at top left, #eaf0ff 0, transparent 34rem), var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -24px 24px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  margin: 0;
  text-align: center;
  flex: 1;
  color: var(--fg);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

#app { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.workspace-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--card) 88%, var(--bg)); box-shadow: var(--shadow); }
.brand-action, .nav-upload { width: 100%; }
.workspace-nav-group { margin-top: 12px; }
.workspace-nav-label { display: block; padding: 0 10px 6px; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.workspace-nav-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: var(--fg); background: transparent; border: 0; box-shadow: none; text-align: left; }
.workspace-nav-item:hover { background: var(--accent-light); color: var(--accent); transform: none; }
.workspace-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 700; }
.workspace-nav-empty { display: block; padding: 8px 10px; color: var(--muted); font-size: .82rem; }
.workspace-main { min-width: 0; }

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

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

.view-heading h2 {
  margin: 2px 0 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.eyebrow {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#me {
  text-align: center;
  flex: 1;
}

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

.menu-wrap {
  position: relative;
}

.hamburger-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--muted);
}

.hamburger-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 40;
}

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(300px, 75vw);
  background: var(--card);
  border-left: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 180ms ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.menu-drawer.menu-closed {
  transform: translateX(100%);
}

.folders-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(300px, 75vw);
  background: var(--card);
  border-right: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 180ms ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.folders-drawer.menu-closed {
  transform: translateX(-100%);
}

.menu-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
}

.menu-drawer-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--fg);
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.menu-item.danger {
  color: var(--danger);
}

.menu-item.danger:hover {
  background: #fef2f2;
}

.menu-item.active-folder {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-light);
}

.trash-folder-menu-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.trash-folder-menu-row .menu-item {
  flex: 1;
}

button.icon-only {
  width: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

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

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--fg);
}

input,
select,
button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

input:focus,
select:focus,
button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button {
  cursor: pointer;
  background: var(--accent);
  color: white;
  border: none;
  font-weight: 500;
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

button.secondary {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
}

button.secondary:hover {
  background: var(--bg);
  border-color: var(--accent);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-item {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  width: 100%;
  color: inherit;
}

.doc-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.doc-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.doc-item .title {
  font-weight: 600;
  font-size: 1rem;
}

.doc-item .meta {
  font-size: 0.875rem;
}

.doc-item .chev {
  font-size: 1.25rem;
  opacity: 0.5;
  flex-shrink: 0;
  color: var(--muted);
}

.doc-item.active {
  border-color: var(--accent);
  background: var(--accent-light);
}
.doc-item-open { display: flex; flex: 1; min-width: 0; justify-content: space-between; align-items: center; gap: 12px; padding: 0; border: 0; background: transparent; color: inherit; box-shadow: none; text-align: left; }
.doc-item-open:hover { background: transparent; transform: none; }
.doc-quick-actions { display: flex; gap: 6px; }
.doc-quick-actions .icon-only { opacity: 0; transition: opacity .15s ease; }
.doc-item:hover .doc-quick-actions .icon-only, .doc-quick-actions .icon-only:focus-visible { opacity: 1; }

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

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.status-inbox {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.status-zu_bezahlen {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

.status-archiv {
  background: #d1fae5;
  color: #047857;
  border-color: #6ee7b7;
}
.status-paid { background: #dcfce7; color: #166534; border-color: #86efac; }
.status-document { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

.error {
  color: var(--danger);
  font-size: 0.875rem;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: var(--radius-sm);
  border: 1px solid #fecaca;
}

.hidden {
  display: none !important;
}

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

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

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  flex: 0 0 auto;
  white-space: nowrap;
}

#tag-pills {
  align-items: flex-start;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 8px;
}

#tag-pills > * {
  width: auto !important;
}

.tag-input-row {
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.tag-input-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.tag-input-row #tag-add {
  width: 40px;
  min-width: 40px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.tag-remove-pill {
  border: none;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  padding: 0;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-remove-pill:hover {
  background: var(--accent);
  color: white;
}

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

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
  font-size: 0.9rem;
}

.search-wrap input {
  padding-left: 36px;
  min-width: 240px;
}
.view-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.view-chip { padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted); font-size: .82rem; box-shadow: none; }
.view-chip:hover, .view-chip.active { background: var(--accent-light); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); transform: none; }
.empty-state { padding: 56px 24px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg); }
.empty-state i { color: var(--accent); font-size: 2rem; }
.empty-state h3 { margin: 12px 0 2px; }
.empty-state p { color: var(--muted); margin: 0 0 16px; }
.toast { position: fixed; z-index: 300; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px); padding: 12px 14px 12px 18px; border-radius: 12px; background: #172033; color: #fff; box-shadow: 0 16px 36px rgba(0,0,0,.22); }
.toast button { padding: 6px 10px; color: #fff; background: transparent; border-color: rgba(255,255,255,.55); }

@media (min-width: 980px) {
  body.detail-open #app { margin-right: min(48vw, 620px); }
  body.detail-open #detail-view { position: fixed; z-index: 30; top: 70px; right: 0; bottom: 0; width: min(48vw, 620px); margin: 0; overflow: auto; border-radius: var(--radius) 0 0 0; }
}

.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);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.quill-wrap .ql-toolbar {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--bg);
}

.inline-field {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

.inline-field-head strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.inline-field-display {
  white-space: pre-wrap;
  font-size: 1rem;
  padding: 8px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.inline-edit-trigger {
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.inline-edit-trigger:hover,
.inline-edit-trigger:focus-visible {
  background: var(--accent-light);
  outline: none;
}

.inline-edit-trigger:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

.action-name-edit {
  display: inline;
  width: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.action-name-edit:hover,
.action-name-edit:focus-visible {
  background: var(--accent-light);
  color: var(--accent);
  outline: none;
}

.action-name-edit:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

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

.inline-notes-display {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 48px;
  background: var(--card);
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.inline-notes-display blockquote,
.inline-field-display blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--border);
  background: var(--bg);
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.inline-editor-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.inline-editor-actions button {
  width: auto;
  min-width: 80px;
}

.detail-actions {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-actions button {
  flex: 1;
  min-width: 0;
}

.attachment-row {
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.attachment-actions-row {
  justify-content: flex-end;
  margin-top: 8px;
}

.attachment-actions-row button {
  width: auto;
}

.attachment-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--bg);
}

.attachment-inline-preview { position: relative; }

.pdf-fallback-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 4px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.pdf-fallback-fullscreen {
  width: 34px;
  height: 34px;
  padding: 5px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
}

.pdf-fallback-fullscreen:hover,
.pdf-fallback-fullscreen:focus-visible {
  color: var(--accent);
  background: var(--accent-light);
  transform: none;
}

.attachment-item:fullscreen,
.attachment-item.pdf-reader-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100vw;
  height: 100vh;
  padding: 16px;
  overflow: hidden;
  background: #101828;
}

.attachment-item.pdf-reader-mode {
  position: fixed;
  inset: 0;
  z-index: 200;
  border: 0;
  border-radius: 0;
}

.pdf-reader-open { overflow: hidden; }

.attachment-item:fullscreen .attachment-row,
.attachment-item.pdf-reader-mode .attachment-row { color: #e6edf8; }

.attachment-item:fullscreen .attachment-inline-preview,
.attachment-item.pdf-reader-mode .attachment-inline-preview {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: auto;
  max-height: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.attachment-item:fullscreen .attachment-preview-pdf-host,
.attachment-item.pdf-reader-mode .attachment-preview-pdf-host,
.attachment-item.pdf-reader-mode .attachment-preview-pdf-host { height: 100%; max-height: none; }

.attachment-item:fullscreen .attachment-preview-pdf-fallback,
.attachment-item.pdf-reader-mode .attachment-preview-pdf-fallback {
  flex: 1;
  height: auto;
  max-height: none;
  min-height: 0;
}

.attachment-item:fullscreen .pdf-fallback-toolbar,
.attachment-item.pdf-reader-mode .pdf-fallback-toolbar { flex: 0 0 auto; }

.attachment-inline-preview {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 240px;
  height: min(60vh, 600px);
  padding: 12px;
  background: var(--card);
  overflow: auto;
}

.attachment-preview-image {
  display: block;
  max-width: 100%;
  max-height: 58vh;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.attachment-preview-pdf-host,
.attachment-preview-pdf-fallback {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  border-radius: var(--radius-sm);
}

.linklike {
  background: transparent;
  border: 0;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-weight: 500;
}

.linklike:hover {
  color: var(--accent-hover);
}

button.linklike {
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

button.linklike:hover {
  background: var(--accent-light);
}

.folder-row {
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--card);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.folder-row:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.2s;
  margin-top: 8px;
}

.dropzone i {
  font-size: 2.5rem;
  color: var(--accent);
}

.dropzone span {
  font-weight: 500;
  color: var(--fg);
}

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

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* Detail view specific styling */
#detail h2 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.field-group {
  margin-bottom: 16px;
}

.field-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
  font-weight: 600;
}

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .workspace-nav { display: none; }
  .layout {
    grid-template-columns: 1fr;
  }
  
  .search-wrap input {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 16px;
  }

  .app-header {
    margin: 0 -16px 16px;
    padding: 10px 16px;
  }

  .card {
    padding: 16px;
  }

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

  .row > * {
    width: 100%;
    min-width: 0;
  }

  input,
  select,
  button {
    width: 100%;
    box-sizing: border-box;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-actions button {
    width: 100%;
  }

  .row label {
    width: 100%;
  }

  .row input,
  .row select {
    width: 100%;
  }

  .inline-editor-actions {
    flex-direction: row;
    align-items: center;
  }

  .inline-editor-actions > * {
    width: auto;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .search-wrap input {
    width: 100%;
  }

  .attachment-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .attachment-row button {
    width: auto;
    align-self: flex-end;
  }

  .folder-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .folder-row .stack-inline {
    width: 100%;
    justify-content: space-between;
  }

  .attachment-actions-row {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 16px;
}

.modal-card {
  width: min(520px, 96vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.modal-card h3 {
  margin: 0 0 12px 0;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

button.danger-btn {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

button.danger-btn:hover {
  background: #dc2626;
}

.doc-summary {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-top: 4px;
  color: var(--muted);
}

#detail-summary,
#entry-summary {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  background: var(--card);
  transition: all 0.2s;
}

#detail-summary:focus,
#entry-summary:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}/* Modal for Token Display */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-hover);
}

.token-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
}

.token-display code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  word-break: break-all;
  overflow-wrap: anywhere;
  background: #fff;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.alert-info {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent-hover);
}

.alert-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 8px;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
}
.checkbox-grid input[type="checkbox"] {
  width: auto;
  margin: 0;
}
