@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap');

:root {
  --paper: #f4efe7;
  --paper-deep: #e9e0d4;
  --ink: #253038;
  --muted: #77766f;
  --line: #d8d0c5;
  --coral: #e46d4f;
  --coral-dark: #c9553a;
  --sage: #a9b6a1;
  --card: #fbf8f2;
  --white: #fffdf9;
  font-family: 'DM Sans', 'Trebuchet MS', sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 87% 8%, #e4e9df 0, transparent 24rem), var(--paper); }
button, input { font: inherit; }
button, label { cursor: pointer; }
.topbar { height: 86px; padding: 0 clamp(24px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.brand-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--coral); }
.brand-mark svg { width: 16px; height: 16px; fill: var(--white); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; font-size: 20px; line-height: 1; transition: .2s ease; }
.icon-button:hover { border-color: var(--ink); background: var(--card); }
.primary-button, .secondary-button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 5px; font-weight: 600; transition: transform .2s ease, background .2s ease; }
.primary-button { color: var(--white); background: var(--coral); }
.primary-button:hover { background: var(--coral-dark); transform: translateY(-1px); }
.primary-button span { margin-right: 5px; font-size: 20px; font-weight: 400; vertical-align: -1px; }
.secondary-button { color: var(--ink); border: 1px solid var(--line); background: transparent; }
.secondary-button:hover { border-color: var(--ink); background: var(--card); }
.danger-button { min-height: 42px; margin-right: auto; padding: 0 4px; border: 0; color: var(--coral-dark); background: transparent; font-size: 12px; font-weight: 600; }
.danger-button:hover { color: #a83d2b; text-decoration: underline; }
main { max-width: 1260px; margin: 0 auto; padding: 72px clamp(24px, 5vw, 76px) 80px; }
.eyebrow { margin: 0 0 14px; color: var(--coral-dark); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h2 { margin: 0; font-family: Fraunces, Georgia, serif; font-weight: 500; letter-spacing: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.bookmark-count, .storage-note { margin: 0; color: var(--muted); font-size: 12px; }
.storage-note { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #799874; }
.bookmark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bookmark-card { position: relative; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--card); text-decoration: none; animation: rise .45s both; }
.bookmark-card:nth-child(2n) { background: #f1eee5; }
.bookmark-card:nth-child(3n) { background: #e8eee7; }
.bookmark-card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: 0 9px 18px #25303812; }
.bookmark-card.is-dragging { opacity: .45; }
.bookmark-card.is-drop-target { border: 2px dashed var(--coral); }
.card-icon { width: 43px; height: 43px; object-fit: cover; border-radius: 11px; background: var(--paper-deep); }
.card-icon-fallback { display: grid; place-items: center; color: var(--coral-dark); font-family: Fraunces, Georgia, serif; font-size: 23px; }
.card-name { display: block; max-width: 100%; margin-top: 20px; overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.card-url { display: block; max-width: 100%; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.card-menu { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 20px; line-height: 1; opacity: 0; }
.bookmark-card:hover .card-menu, .card-menu:focus { opacity: 1; background: #ffffff88; }
.card-menu:hover { color: var(--ink); }
.empty-state { padding: 80px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 7px; }
.empty-icon { margin-bottom: 20px; color: var(--coral); font-size: 28px; }
.empty-state h2 { font-size: 30px; }
.empty-state p { margin: 9px auto 24px; color: var(--muted); font-size: 14px; }
.bookmark-dialog { width: min(100% - 32px, 470px); padding: 0; border: 0; border-radius: 9px; color: var(--ink); background: var(--white); box-shadow: 0 20px 70px #25303830; }
.bookmark-dialog::backdrop { background: #25303866; backdrop-filter: blur(3px); }
.bookmark-dialog form { padding: 30px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 27px; }
.dialog-heading .eyebrow { margin-bottom: 8px; }
.dialog-heading h2 { font-size: 31px; }
.close-button { width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 25px; line-height: 1; }
.close-button:hover { background: var(--paper); color: var(--ink); }
.bookmark-dialog label:not(.icon-button) { display: block; margin: 15px 0 7px; font-size: 12px; font-weight: 700; }
.required { color: var(--coral); }
.optional { color: var(--muted); font-weight: 400; }
.bookmark-dialog input:not([type="file"]) { width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--line); border-radius: 4px; outline: 0; color: var(--ink); background: var(--paper); }
.bookmark-dialog input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px #e46d4f22; }
.form-hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.move-actions { display: flex; gap: 9px; margin-top: 20px; }
.move-actions .secondary-button { min-height: 36px; padding: 0 12px; font-size: 12px; }
.move-actions .secondary-button:disabled { cursor: not-allowed; opacity: .45; }
.dialog-actions { display: flex; justify-content: end; gap: 9px; margin-top: 28px; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 16px; border-radius: 5px; color: var(--white); background: var(--ink); font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) { .topbar { height: 72px; padding: 0 18px; } .top-actions { gap: 6px; } .top-actions .icon-button { display: none; } .primary-button { padding: 0 12px; font-size: 12px; } main { padding: 48px 18px 60px; } .bookmark-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; } .bookmark-card { min-height: 165px; padding: 15px; } .card-menu { opacity: 1; top: 9px; right: 9px; } .bookmark-dialog form { padding: 24px; } }
