:root {
  --bg: #f0f2f5;
  --bg-strong: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f8fafc;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #06b6d4;
  --danger: #ef4444;
  --success: #10b981;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

.daily-bookmarks-view *,
.daily-bookmarks-view *::before,
.daily-bookmarks-view *::after {
  box-sizing: border-box;
}

.daily-bookmarks-view {
  margin: 0;
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.daily-bookmarks-view a {
  color: var(--accent-2);
  text-decoration: none;
}

.daily-bookmarks-view a:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.daily-bookmarks-view .daily-shell {
  max-width: var(--content-max-width, 1600px);
  margin: 0 auto;
  padding: 0 18px 36px;
}

.daily-bookmarks-view .hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.back-link {
  align-self: flex-start;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 4px;
}

.back-link:hover {
  text-decoration: underline;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pill--soft {
  background: rgba(255, 255, 255, 0.08);
}

.pill--accent {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.15), rgba(6, 182, 212, 0.15));
  color: #0f172a;
  border-color: rgba(37, 99, 235, 0.25);
}

.hero__title {
  font-size: clamp(30px, 3vw, 36px);
  margin: 0;
  letter-spacing: -0.01em;
}

.hero__lead {
  margin: 0;
  color: var(--muted);
  max-width: 840px;
}

.hero__lead code {
  background: rgba(37, 99, 235, 0.08);
  padding: 3px 6px;
  border-radius: 8px;
  color: var(--text);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.auto-open-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.12), transparent 42%),
    radial-gradient(circle at 80% 30%, rgba(6, 182, 212, 0.12), transparent 38%),
    rgba(15, 23, 42, 0.6);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.auto-open-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.auto-open-overlay__panel {
  width: min(940px, 100%);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.96));
  border-radius: 22px;
  padding: 38px 42px 40px;
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  text-align: center;
  cursor: pointer;
}

.auto-open-overlay__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

.auto-open-overlay__timer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 8px;
  color: #0f172a;
}

.auto-open-overlay__count {
  font-size: clamp(72px, 12vw, 120px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auto-open-overlay__unit {
  font-size: 22px;
  color: var(--muted);
}

.auto-open-overlay__text {
  margin: 0 auto;
  color: #334155;
  max-width: 700px;
  font-size: 18px;
}

.auto-open-overlay__hint {
  margin: 12px 0 0;
  color: #475569;
  font-size: 15px;
}

.hero__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.day-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.day-switch__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
}

.day-switch__day {
  font-weight: 700;
}

.day-switch__sub {
  color: var(--muted);
  font-size: 13px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero__stats {
  color: var(--muted);
  font-size: 14px;
}

.bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 12px;
}

.bulk-actions label {
  color: var(--muted);
  font-size: 13px;
}

.auto-open-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.auto-open-toggle input {
  width: 16px;
  height: 16px;
}

.bulk-actions select {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.panel__header--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel__eyebrow {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel__title {
  margin: 0;
  font-size: 22px;
}

.panel__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.list-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.list-status--error {
  color: var(--danger);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  color: var(--muted);
  font-size: 14px;
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.field__hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.field--switch {
  align-items: flex-start;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.switch-control__label {
  color: var(--text);
  font-weight: 600;
}

.field--switch input[type='checkbox'] {
  width: auto;
  min-width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin: 0;
}

.form-preview {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-strong);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
}

.form-preview__label {
  margin: 0 0 4px 0;
  color: var(--muted);
}

.form-preview__link {
  display: inline-block;
  max-width: 620px;
  word-break: break-all;
}

.form-preview__actions {
  display: flex;
  gap: 8px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 14px;
  transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 45px rgba(34, 211, 238, 0.3);
}

.secondary-btn {
  background: #f8fafc;
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-btn:hover {
  border-color: var(--accent);
}

.ghost-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.ghost-btn--today {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}

.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost-btn--tiny {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.placeholder-help {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.placeholder-help__title {
  margin: 0 0 6px 0;
  font-weight: 700;
}

.placeholder-help__list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.form-status {
  min-height: 18px;
  font-size: 14px;
  color: var(--muted);
}

.form-status--error {
  color: var(--danger);
}

.suggestion-box {
  margin-top: -4px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.suggestion-box__item {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
}

.suggestion-box__text {
  color: var(--muted);
  font-size: 14px;
}

.suggestion-btn {
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.suggestion-btn:hover {
  border-color: var(--accent);
}

.suggestion-preview {
  display: inline-block;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.suggestion-preview:hover {
  text-decoration: underline;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.bookmark-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.bookmark-table th,
.bookmark-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  background: transparent;
}

.bookmark-table th {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.bookmark-table th.col-marker {
  width: 180px;
}

.bookmark-table th.col-created {
  width: 160px;
}

.bookmark-table th.col-last {
  width: 220px;
}

.bookmark-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.bookmark-table tr.is-done td {
  background: rgba(16, 185, 129, 0.12);
  border-bottom-color: rgba(16, 185, 129, 0.3);
}

.bookmark-table td:last-child {
  white-space: nowrap;
  text-align: right;
}

.bookmark-table tr.is-open td {
  background: rgba(37, 99, 235, 0.08);
  border-bottom-color: rgba(37, 99, 235, 0.2);
}

.bookmark-table tr.is-inactive td {
  background: rgba(107, 114, 128, 0.16);
  border-bottom-color: rgba(107, 114, 128, 0.28);
  color: var(--muted);
}

.bookmark-table tr.is-inactive a {
  color: var(--muted);
}

.chip {
  border-radius: 12px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.chip--marker {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.12));
  color: #0f172a;
  border-color: rgba(37, 99, 235, 0.2);
}

.chip--inactive {
  background: rgba(107, 114, 128, 0.22);
  color: #0f172a;
  border-color: rgba(107, 114, 128, 0.32);
  margin-left: 8px;
}

.list-summary {
  color: var(--muted);
  font-size: 14px;
}

.empty-state,
.error-state,
.loading-state {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

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

.table-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.table-actions .ghost-btn {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 10px;
}

.bookmark-table .note-cell {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-table .url-cell {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-table .marker-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
}

.modal__content {
  width: min(720px, 92vw);
  background: var(--bg-strong);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
}

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

.modal__close {
  border-radius: 999px;
}

.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0;
}

.sort-btn::after {
  content: '↕';
  font-size: 12px;
  color: var(--muted);
  opacity: 0.6;
}

.sort-btn.is-active {
  color: var(--text);
}

.sort-btn.is-active::after {
  content: attr(data-sort-direction);
  opacity: 1;
  color: var(--accent);
}

.table-filter-row th {
  background: rgba(37, 99, 235, 0.05);
  border-bottom: 1px solid rgba(37, 99, 235, 0.15);
}

.table-filter-row select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.table-filter-row input[type="search"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.filter-hint {
  font-size: 12px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.import-hint {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 10px;
}

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

@media (max-width: 640px) {
  .panel__header--row {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-preview {
    flex-direction: column;
    align-items: flex-start;
  }
}
