:root {
  --ink: #18252d;
  --muted: #6f7d82;
  --cream: #f6f3eb;
  --paper: #fffefa;
  --line: #deddd4;
  --green: #1d775c;
  --green-dark: #125843;
  --lime: #d9f2a3;
  --orange: #ef8c4a;
  --shadow: 0 18px 50px rgba(31, 45, 43, .10);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); font-family: "DM Sans", sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .28; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E"); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); font-weight: 700; }
.site-header { height: 76px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(246,243,235,.88); backdrop-filter: blur(15px); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: "Space Grotesk"; font-size: 19px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px 11px 11px 3px; color: white; background: var(--green); }
.header-actions { display: flex; align-items: center; gap: 15px; }
.user-name { color: var(--muted); font-size: 14px; }
.main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; position: relative; }
.button { border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green); box-shadow: 0 8px 18px rgba(29,119,92,.20); }
.button-primary:hover { background: var(--green-dark); }
.button-ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button-small { padding: 8px 12px; }
.button-full { width: 100%; padding: 14px; }
.auth-shell { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(40px, 8vw, 100px); align-items: center; padding: 55px 4vw; }
.auth-intro h1, .dashboard-heading h1 { font-family: "Space Grotesk"; letter-spacing: -.04em; line-height: 1.04; }
.auth-intro h1 { max-width: 600px; font-size: clamp(43px, 6vw, 76px); margin: 16px 0 22px; }
.auth-intro p { max-width: 560px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.eyebrow { color: var(--green); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; }
.demo-chip { margin-top: 38px; width: min(390px, 100%); display: flex; justify-content: space-between; padding: 17px 19px; border-radius: 13px; background: var(--lime); transform: rotate(-2deg); box-shadow: 6px 7px 0 var(--ink); }
.demo-chip b { color: var(--green-dark); }
.auth-card { max-width: 470px; width: 100%; justify-self: end; padding: clamp(26px, 5vw, 44px); border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.auth-card h2 { font: 700 29px "Space Grotesk"; margin: 0 0 7px; }
.muted { color: var(--muted); }
.stacked-form, .modal-card { display: grid; gap: 18px; }
.stacked-form { margin-top: 26px; }
label { display: grid; gap: 7px; font-weight: 700; font-size: 14px; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; transition: .2s; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,119,92,.12); }
textarea { resize: vertical; }
label small { color: var(--muted); font-weight: 400; }
.auth-switch { text-align: center; margin: 22px 0 0; color: var(--muted); }
.error-list, .flash { padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.error-list, .flash-error { color: #8b302f; background: #fbe2df; }
.flash-success { color: #145a43; background: #ddf2e9; }
.flash { position: fixed; top: 88px; left: 50%; z-index: 15; transform: translateX(-50%); box-shadow: var(--shadow); animation: arrive .3s ease; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 60px 0 37px; }
.dashboard-heading h1 { font-size: clamp(36px, 5vw, 58px); margin: 10px 0 8px; }
.dashboard-heading p { margin: 0; }
.toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 26px; }
.search-wrap { position: relative; width: min(420px, 100%); }
.search-wrap span { position: absolute; left: 13px; top: 9px; font-size: 22px; color: var(--muted); }
.search-wrap input { padding-left: 40px; background: rgba(255,255,255,.68); }
.filters { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; }
.filter { border: 0; padding: 8px 13px; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.filter.active { color: white; background: var(--ink); }
.filter span { margin-left: 4px; opacity: .6; }
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 70px; }
.item-card { min-width: 0; min-height: 235px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 4px 0 rgba(24,37,45,.06); cursor: pointer; transition: .2s ease; outline: none; }
.item-card:hover, .item-card:focus-visible { transform: translateY(-4px); border-color: #aebbb5; box-shadow: var(--shadow); }
.item-card.copied { border-color: var(--green); background: #f2faed; }
.item-top { display: flex; align-items: center; }
.type-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; font-weight: 700; }
.type-word { background: var(--lime); color: var(--green-dark); }
.type-link { background: #ffe0cb; color: #a44e17; }
.type-label { margin-left: 9px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.item-actions { margin-left: auto; display: flex; gap: 5px; }
.item-actions form { display: contents; }
.icon-button { display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-decoration: none; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: #eeece4; }
.delete-button:hover { color: #a72d28; background: #fae4e2; }
.item-card h2 { margin: 20px 0 8px; font: 700 20px "Space Grotesk"; }
.item-card p { color: var(--muted); margin: 0; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.copy-hint { margin-top: auto; padding-top: 18px; display: flex; justify-content: space-between; color: var(--green); font-size: 12px; font-weight: 700; }
.copy-hint b { color: var(--muted); }
.empty-state { max-width: 620px; margin: 30px auto; padding: 65px 30px; text-align: center; border: 1px dashed #aeb6ae; border-radius: 20px; background: rgba(255,255,255,.35); }
.empty-icon { margin: 0 auto 18px; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; color: white; background: var(--green); font-size: 25px; transform: rotate(-5deg); }
.empty-state h2 { font: 700 27px "Space Grotesk"; margin: 0; }
.empty-state p { color: var(--muted); margin: 10px auto 24px; max-width: 420px; line-height: 1.6; }
.no-results { text-align: center; color: var(--muted); padding: 55px; }
.modal { width: min(570px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 20px; background: var(--paper); box-shadow: 0 30px 90px rgba(20,35,30,.25); }
.modal::backdrop { background: rgba(20,31,30,.52); backdrop-filter: blur(3px); }
.modal-card { padding: 30px; }
.modal-header { display: flex; justify-content: space-between; align-items: start; }
.modal-header h2 { font: 700 27px "Space Grotesk"; margin: 5px 0 0; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
fieldset { padding: 0; border: 0; }
legend { margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-options label input { position: absolute; opacity: 0; pointer-events: none; }
.type-options label span { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.type-options input:checked + span { border-color: var(--green); background: #edf7f1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translate(-50%, 30px); padding: 12px 18px; border-radius: 10px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
[hidden] { display: none !important; }
@keyframes arrive { from { opacity: 0; transform: translate(-50%, -10px); } }
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; padding: 45px 0; }
  .auth-intro h1 { font-size: 48px; }
  .auth-card { justify-self: center; max-width: 560px; }
  .item-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .main { width: min(100% - 26px, 1180px); }
  .site-header { padding: 0 14px; }
  .user-name { display: none; }
  .auth-intro h1 { font-size: 39px; }
  .auth-intro { padding-top: 12px; }
  .dashboard-heading { align-items: start; flex-direction: column; padding-top: 40px; }
  .dashboard-heading .button { width: 100%; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-wrap { width: 100%; }
  .filters { overflow-x: auto; }
  .item-grid { grid-template-columns: 1fr; }
  .item-card { min-height: 220px; }
  .modal-card { padding: 22px; }
}
