:root {
  color-scheme: dark;
  --background: #10151b;
  --panel: #171e27;
  --panel-raised: #202a36;
  --border: #2b3744;
  --muted: #929eaa;
  --text: #edf2f7;
  --accent: #438fd1;
  --accent-bright: #70b7f1;
  --danger: #e0786d;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--background); font-family: "DM Sans", sans-serif; font-size: 14px; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.layout { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; width: 248px; height: 100vh; grid-column: 1; grid-row: 1; flex-direction: column; padding: 28px 18px 20px; border-right: 1px solid #26313d; background: #131a22; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid var(--accent); color: var(--accent-bright); font-family: "Barlow Condensed", sans-serif; font-size: 23px; font-weight: 800; transform: skew(-7deg); }
.brand-name { font-family: "Barlow Condensed", sans-serif; font-size: 20px; font-weight: 800; letter-spacing: 1.5px; }
.brand-name span { display: block; margin-top: -3px; color: var(--accent-bright); font-size: 10px; letter-spacing: 3.1px; }
.sidebar-label { margin: 56px 10px 13px; color: #74756e; font-size: 9px; font-weight: 700; letter-spacing: 1.6px; }
.navigation { display: grid; gap: 10px; margin-top: 36px; }
.nav-link { display: flex; align-items: center; gap: 13px; padding: 14px 11px; border: 1px solid transparent; border-radius: 4px; color: #a7a89f; transition: color .18s, background .18s, border-color .18s; }
.nav-link:hover, .nav-link.active { border-color: #34516b; color: var(--accent-bright); background: #1a2a39; }
.nav-icon { width: 18px; color: var(--accent-bright); font-size: 17px; text-align: center; }
.sidebar-bottom { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 14px 9px; border-top: 1px solid #292a25; color: #898a82; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a8bd70; box-shadow: 0 0 10px #a8bd7066; }
.main-content { width: min(1440px, 100%); min-width: 0; min-height: 100vh; grid-column: 2; grid-row: 1; margin: 0; padding: 0 54px 70px; }
.topbar { display: flex; height: 72px; align-items: center; justify-content: space-between; border-bottom: 1px solid #252621; }
.breadcrumb, .eyebrow { color: #96978f; font-size: 9px; font-weight: 700; letter-spacing: 1.65px; }
.breadcrumb span { padding: 0 8px; color: var(--accent-bright); }
.topbar-link { color: #aaa99f; font-size: 12px; transition: color .18s; }
.topbar-link:hover { color: var(--accent-bright); }
.topbar-link span { margin-left: 7px; color: var(--accent-bright); }
.logout-button { border: 0; padding: 8px 0; background: transparent; cursor: pointer; font-family: inherit; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin: 51px 0 34px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--accent-bright); }
.eyebrow-line { width: 19px; height: 1px; background: var(--accent-bright); }
h1, h2, p { margin-top: 0; }
h1 { margin: 9px 0 3px; font-family: "Barlow Condensed", sans-serif; font-size: clamp(40px, 5vw, 58px); font-weight: 800; letter-spacing: .6px; line-height: 1; }
h1 span { color: var(--accent-bright); }
.page-description { margin: 11px 0 0; color: var(--muted); font-size: 13px; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 3px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .18s, background .18s, border-color .18s; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--accent); color: #f8fbff; background: var(--accent); }
.button-primary:hover { border-color: var(--accent-bright); background: var(--accent-bright); }
.button-primary span { font-size: 18px; font-weight: 400; }
.button-outline { border-color: #34516b; color: var(--accent-bright); background: transparent; }
.button-outline:hover { background: #1b2936; }
.button-quiet { border-color: var(--border); color: #c5c5bb; background: transparent; }
.button-quiet:hover { border-color: #56574e; }
.editor-panel { margin: 0 0 27px; padding: 23px 25px 20px; border: 1px solid #354352; border-top: 2px solid var(--accent); border-radius: 4px; background: var(--panel); animation: enter .22s ease-out; }
.editor-panel[hidden] { display: none; }
.editor-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 21px; }
.editor-heading h2 { margin: 4px 0 0; font-family: "Barlow Condensed", sans-serif; font-size: 23px; letter-spacing: .5px; }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 3px; color: #b6b7ae; background: transparent; cursor: pointer; font-size: 20px; line-height: 1; }
.icon-button:hover { color: var(--accent-bright); }
.content-form { display: grid; gap: 14px; }
.content-form label { display: grid; gap: 7px; color: #b9b9af; font-size: 11px; font-weight: 600; }
.content-form input, .content-form textarea { width: 100%; border: 1px solid #35414e; border-radius: 3px; outline: none; padding: 11px 12px; color: var(--text); background: #11171e; font-size: 12px; transition: border-color .18s; }
.content-form textarea { min-height: 82px; resize: vertical; }
.content-form input:focus, .content-form textarea:focus { border-color: var(--accent); }
.content-form input::placeholder, .content-form textarea::placeholder { color: #66675f; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 2px; }
.form-error { min-height: 0; margin: 0; color: var(--danger); font-size: 12px; }
.dashboard-grid, .mods-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.content-card, .mod-card { overflow: hidden; min-width: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); animation: enter .25s ease-out both; transition: border-color .2s, transform .2s; }
.note-card { min-width: 0; border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: 4px; background: var(--panel); animation: enter .25s ease-out both; }
.content-card:hover, .mod-card:hover { transform: translateY(-3px); border-color: #3c75a4; }
.content-card-image, .mod-card-image { display: block; width: 100%; height: 168px; object-fit: cover; background: #20211c; }
.content-card-body, .mod-card-body { padding: 17px; }
.content-card h3, .mod-card h3 { margin: 0 0 9px; font-family: "Barlow Condensed", sans-serif; font-size: 21px; letter-spacing: .3px; }
.content-card p, .mod-card p { margin: 0; color: #a4a59c; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.card-link { display: inline-block; margin-top: 13px; color: var(--accent-bright); font-size: 11px; font-weight: 700; }
.card-actions { display: flex; gap: 7px; margin-top: 17px; padding-top: 13px; border-top: 1px solid #2b2c27; }
.small-button { min-height: 30px; padding: 0 9px; border: 1px solid #3b3c35; border-radius: 3px; color: #bbbbb1; background: transparent; cursor: pointer; font-size: 10px; transition: border-color .18s, color .18s; }
.small-button:hover { border-color: var(--accent); color: var(--accent-bright); }
.small-button.danger:hover { border-color: var(--danger); color: var(--danger); }
.small-button:disabled { opacity: .38; cursor: default; }
.mod-card-link { display: block; color: inherit; }
.mod-card-link:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: -2px; }
.mod-card-open { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; color: var(--accent-bright); font-size: 11px; font-weight: 700; }
.empty-state { display: grid; min-height: 315px; justify-items: center; align-content: center; padding: 38px 20px; border: 1px dashed #354352; border-radius: 4px; text-align: center; background: radial-gradient(ellipse at 50% 25%, #202c38 0, #151c24 50%, #141a21 100%); }
.empty-state[hidden] { display: none; }
.empty-emblem { display: grid; width: 49px; height: 49px; place-items: center; margin-bottom: 17px; border: 1px solid #34516b; color: var(--accent-bright); font-size: 25px; }
.empty-state h2 { margin-bottom: 8px; font-family: "Barlow Condensed", sans-serif; font-size: 24px; letter-spacing: .7px; }
.empty-state p { max-width: 410px; margin-bottom: 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.empty-state .button span { font-size: 16px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 5; max-width: min(400px, calc(100vw - 32px)); padding: 12px 16px; transform: translateY(12px); border: 1px solid #4e482e; border-radius: 3px; opacity: 0; color: var(--text); background: #201f19; box-shadow: 0 12px 30px #0005; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { border-color: #73433e; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 20%, #202c38 0, #10151b 55%); }
.login-card { width: min(100%, 440px); padding: 38px; border: 1px solid var(--border); border-top: 2px solid var(--accent); border-radius: 4px; background: var(--panel); box-shadow: 0 24px 80px #0005; }
.login-brand { margin-bottom: 43px; padding: 0; }
.login-card h1 { margin-top: 17px; font-size: clamp(32px, 8vw, 44px); }
.login-card .content-form { margin-top: 26px; }
.login-card .content-form .button { width: 100%; margin-top: 5px; }
.login-card .form-error { min-height: 18px; }
@keyframes enter { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 1100px) { .main-content { padding-right: 34px; padding-left: 34px; } .dashboard-grid, .mods-grid, .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 3; width: 100%; height: 60px; grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; justify-content: space-between; padding: 0 16px; border-right: 0; border-bottom: 1px solid #26313d; }
  .brand { gap: 8px; padding: 0; }.brand-mark { width: 30px; height: 30px; font-size: 19px; }.brand-name { font-size: 16px; }.brand-name span { font-size: 8px; }
  .sidebar-label, .sidebar-bottom { display: none; }.navigation { display: flex; gap: 3px; margin-top: 0; }.nav-link { gap: 6px; padding: 9px 10px; font-size: 11px; }.nav-icon { width: auto; font-size: 15px; }
  .main-content { grid-column: 1; grid-row: 2; margin-left: 0; padding: 0 20px 45px; }.topbar { height: 51px; }.breadcrumb { font-size: 8px; }.topbar-link { font-size: 11px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin: 36px 0 25px; }.page-heading > .button { align-self: flex-start; }
  .dashboard-grid, .mods-grid, .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.content-card-image, .mod-card-image { height: 140px; }
}
@media (max-width: 480px) {
  .main-content { padding-right: 14px; padding-left: 14px; }.navigation { gap: 1px; }.nav-link { padding: 8px 7px; font-size: 10px; }.nav-icon { display: none; }.topbar-link { font-size: 10px; }
  .dashboard-grid, .mods-grid, .notes-grid { grid-template-columns: 1fr; }.content-card-image, .mod-card-image { height: 190px; }.form-row { grid-template-columns: 1fr; }.editor-panel { padding: 19px 16px; }
  .empty-state { min-height: 285px; }.empty-state h2 { font-size: 21px; }
}
@media (max-width: 480px) { .login-card { padding: 27px 21px; } }
