:root {
  --bg: #f3f0e8;
  --panel: #faf8f2;
  --panel-strong: #ffffff;
  --ink: #202620;
  --muted: #767a73;
  --line: #d9d6cd;
  --accent: #d7ff64;
  --accent-ink: #1c2418;
  --sidebar: #222923;
  --sidebar-muted: #9fa79f;
  --shadow: 0 18px 50px rgba(31, 37, 31, 0.1);
  --font: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); min-height: 100vh; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(112, 143, 34, .35); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; background: var(--sidebar); color: #f5f6f1; padding: 30px 22px 24px; display: flex; flex-direction: column; z-index: 20; }
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px 12px 12px 3px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 22px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 18px; letter-spacing: .08em; }
.brand-copy small { font-size: 9px; color: var(--sidebar-muted); letter-spacing: .18em; }
.category-nav { display: grid; gap: 5px; margin-top: 50px; }
.nav-label { color: #6f786f; padding: 22px 14px 7px; font-size: 10px; text-transform: uppercase; letter-spacing: .18em; }
.nav-item, .utility-button { border: 0; background: transparent; color: var(--sidebar-muted); border-radius: 10px; min-height: 46px; padding: 0 13px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; transition: .2s ease; }
.nav-item svg, .utility-button svg { width: 18px; height: 18px; }
.nav-item span, .utility-button span { flex: 1; }
.nav-item em { font-style: normal; font-size: 11px; color: #7f897f; }
.nav-item:hover, .utility-button:hover { color: #fff; background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-item.active { color: var(--accent); background: rgba(215,255,100,.09); }
.nav-item.active em { color: var(--accent); }
.sidebar-note { margin-top: auto; padding: 18px 16px; border: 1px solid #3d463e; border-radius: 12px; color: var(--sidebar-muted); font-size: 12px; line-height: 1.65; position: relative; }
.sidebar-note p { margin: 0; }
.note-dot { position: absolute; top: -5px; right: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--sidebar); }
.sidebar-footer { display: grid; gap: 3px; margin-top: 15px; }
.utility-button { width: 100%; min-height: 40px; font-size: 13px; }

.main-content { grid-column: 2; max-width: 1500px; width: 100%; margin: 0 auto; padding: 0 5.5vw 50px; }
.topbar { height: 90px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.today { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.command-hint { height: 40px; border: 1px solid var(--line); background: rgba(255,255,255,.38); border-radius: 10px; padding: 0 10px 0 13px; display: flex; align-items: center; gap: 9px; color: var(--muted); cursor: pointer; }
.command-hint svg { width: 15px; }
kbd { border: 1px solid var(--line); background: var(--panel-strong); border-radius: 5px; padding: 2px 6px; font-size: 10px; color: var(--muted); box-shadow: 0 1px 0 var(--line); }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ink); color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; cursor: pointer; }

.hero { padding: clamp(70px, 9vw, 125px) 0 82px; max-width: 940px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; letter-spacing: .18em; font-weight: 700; }
.eyebrow span { width: 30px; height: 2px; background: var(--ink); }
.eyebrow b { color: var(--ink); }
.hero h1 { font-size: clamp(48px, 6.2vw, 88px); line-height: .98; letter-spacing: -.055em; margin: 24px 0 22px; font-weight: 600; }
.hero h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.hero > p { margin: 0 0 36px; color: var(--muted); font-size: 15px; }
.search-box { position: relative; display: flex; align-items: center; max-width: 780px; height: 68px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-strong); box-shadow: 0 12px 36px rgba(31,37,31,.07); transition: .2s; }
.search-box:focus-within { border-color: #88976f; box-shadow: 0 15px 45px rgba(31,37,31,.12); transform: translateY(-1px); }
.search-engine-wrap { height: 100%; position: relative; display: flex; align-items: center; }
.engine-button { height: 40px; min-width: 65px; margin-left: 13px; border: 0; border-right: 1px solid var(--line); background: none; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.engine-button span { width: 27px; height: 27px; border-radius: 7px; background: var(--ink); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.engine-button svg { width: 13px; color: var(--muted); }
.engine-menu { display: none; position: absolute; top: 58px; left: 10px; z-index: 15; min-width: 145px; border: 1px solid var(--line); background: var(--panel-strong); border-radius: 11px; padding: 6px; box-shadow: var(--shadow); }
.engine-menu.open { display: grid; }
.engine-menu button { border: 0; background: transparent; padding: 9px; display: flex; align-items: center; gap: 9px; border-radius: 7px; cursor: pointer; text-align: left; }
.engine-menu button:hover { background: var(--bg); }
.engine-menu button span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 6px; font-size: 9px; font-weight: 800; }
.search-icon { width: 19px; margin-left: 18px; color: var(--muted); }
.search-box input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; padding: 0 14px; background: transparent; color: var(--ink); font-size: 15px; }
.search-box input::placeholder { color: #a0a39d; }
.search-submit { margin-right: 10px; width: 47px; height: 47px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; transition: .2s; }
.search-submit:hover { transform: rotate(3deg) scale(1.04); }
.search-submit svg { width: 20px; }
.quick-keys { display: flex; gap: 22px; color: var(--muted); font-size: 11px; padding: 12px 4px 0; }

.section-block { padding: 36px 0 84px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 30px; }
.section-heading > div:first-child { display: flex; align-items: baseline; gap: 14px; }
.section-index { color: #92968f; font-size: 10px; letter-spacing: .16em; font-weight: 700; }
.section-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.heading-actions { display: flex; gap: 9px; }
.primary-button, .secondary-button, .danger-button, .text-button { min-height: 40px; border-radius: 9px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-size: 12px; font-weight: 600; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: var(--accent); }
.secondary-button { border: 1px solid var(--line); background: transparent; }
.danger-button { border: 1px solid #e1b5ad; background: #fff4f1; color: #a94432; }
.text-button { border: 0; background: transparent; color: var(--muted); }
.primary-button svg, .secondary-button svg, .danger-button svg, .text-button svg { width: 15px; height: 15px; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(31,37,31,.15); }
.site-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.site-card { position: relative; min-height: 154px; border: 1px solid var(--line); background: rgba(255,255,255,.32); border-radius: 13px; padding: 18px; display: flex; flex-direction: column; transition: .22s ease; overflow: hidden; }
.site-card::after { content: ""; position: absolute; width: 55px; height: 55px; border-radius: 50%; right: -25px; bottom: -25px; background: var(--card-color); opacity: .35; transition: .25s; }
.site-card:hover { transform: translateY(-4px); background: var(--panel-strong); box-shadow: 0 15px 30px rgba(31,37,31,.08); border-color: #c7c6bd; }
.site-card:hover::after { transform: scale(1.8); opacity: .22; }
.card-top { display: flex; justify-content: space-between; align-items: start; }
.site-icon { width: 42px; height: 42px; border-radius: 10px 10px 10px 3px; display: grid; place-items: center; background: var(--card-color); color: #202620; font-size: 12px; font-weight: 800; letter-spacing: -.03em; }
.card-actions { position: relative; z-index: 2; display: flex; gap: 3px; opacity: 0; transition: .2s; }
.site-card:hover .card-actions, .favorite-button.active { opacity: 1; }
.card-icon-button { width: 29px; height: 29px; border: 0; border-radius: 7px; background: transparent; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.card-icon-button:hover { background: var(--bg); color: var(--ink); }
.card-icon-button svg { width: 15px; }
.favorite-button.active { color: #d28d18; }
.favorite-button.active svg { fill: currentColor; }
.site-card h3 { font-size: 15px; margin: auto 0 5px; }
.site-card p { color: var(--muted); font-size: 11px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-arrow { position: absolute; right: 17px; bottom: 16px; width: 16px; color: var(--muted); opacity: .45; }
.empty-state { text-align: center; padding: 65px 20px; border: 1px dashed var(--line); border-radius: 13px; }
.empty-state > svg { width: 34px; color: var(--muted); }
.empty-state h3 { margin: 12px 0 5px; }
.empty-state p { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.focus-panel { border: 1px solid var(--line); background: var(--panel); border-radius: 15px; padding: clamp(28px,4vw,50px); display: flex; justify-content: space-between; align-items: center; gap: 40px; position: relative; overflow: hidden; }
.focus-panel::before { content: "START"; position: absolute; right: 240px; top: 50%; transform: translateY(-52%); font-size: 100px; font-weight: 800; letter-spacing: -.08em; color: transparent; -webkit-text-stroke: 1px var(--line); opacity: .6; pointer-events: none; }
.focus-copy { position: relative; z-index: 1; }
.focus-copy h2 { font-size: clamp(26px,3vw,42px); letter-spacing: -.04em; margin: 14px 0; }
.focus-copy p { color: var(--muted); font-size: 12px; margin: 0; }
.clock-card { flex: 0 0 185px; min-height: 150px; border-radius: 12px; background: var(--ink); color: #fff; padding: 22px; display: flex; flex-direction: column; position: relative; z-index: 1; }
.clock-card span, .clock-card small { color: #aeb5ae; font-size: 10px; letter-spacing: .12em; }
.clock-card strong { font-size: 42px; line-height: 1; margin: auto 0 6px; letter-spacing: -.06em; color: var(--accent); }
footer { display: flex; justify-content: space-between; padding: 28px 2px 0; color: var(--muted); font-size: 10px; letter-spacing: .05em; }

.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon-button svg { width: 18px; }
.mobile-only { display: none; }
.overlay { display: none; }

.modal, .command-modal { border: 1px solid var(--line); border-radius: 15px; background: var(--panel-strong); color: var(--ink); padding: 0; box-shadow: var(--shadow); }
.modal { width: min(540px, calc(100vw - 30px)); }
.modal::backdrop, .command-modal::backdrop { background: rgba(17,22,18,.52); backdrop-filter: blur(3px); }
.modal form { padding: 25px; }
.modal-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 24px; }
.modal-header h2 { margin: 5px 0 0; font-size: 24px; }
.modal label { display: grid; gap: 7px; margin-bottom: 16px; font-size: 11px; font-weight: 600; color: var(--muted); }
.modal input, .modal select { height: 45px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); padding: 0 12px; outline: none; }
.modal input:focus, .modal select:focus { border-color: #8c9d68; }
.form-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.color-picker { display: flex; gap: 10px; padding: 2px 0 23px; }
.color-swatch { width: 29px; height: 29px; border-radius: 50%; border: 4px solid var(--panel-strong); background: var(--swatch); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.color-swatch.active { box-shadow: 0 0 0 2px var(--ink); }
.modal-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 9px; padding-top: 5px; }

.command-modal { width: min(610px, calc(100vw - 30px)); margin-top: 15vh; }
.command-search { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.command-search svg { width: 20px; color: var(--muted); }
.command-search input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.command-close { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.command-close:hover { background: var(--bg); color: var(--ink); }
.command-close svg { width: 15px; }
.command-results { max-height: 360px; overflow-y: auto; padding: 8px; }
.command-item { width: 100%; border: 0; background: transparent; border-radius: 8px; min-height: 55px; padding: 8px 10px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; }
.command-item:hover, .command-item.selected { background: var(--bg); }
.command-item .site-icon { width: 35px; height: 35px; }
.command-item div { display: grid; gap: 2px; }
.command-item strong { font-size: 13px; }
.command-item small { color: var(--muted); font-size: 10px; }
.command-item > svg { margin-left: auto; width: 15px; color: var(--muted); }
.command-empty { text-align: center; color: var(--muted); padding: 45px; font-size: 13px; }
.command-footer { display: flex; gap: 18px; padding: 11px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; transform: translate(-50%, 25px); opacity: 0; pointer-events: none; background: var(--ink); color: white; border-radius: 10px; padding: 11px 16px; display: flex; align-items: center; gap: 9px; font-size: 12px; transition: .25s; box-shadow: var(--shadow); }
.toast svg { width: 16px; color: var(--accent); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.dark { --bg: #151a16; --panel: #1b211c; --panel-strong: #202721; --ink: #eef2e9; --muted: #939c93; --line: #343c35; --accent-ink: #192016; --sidebar: #0d110e; --shadow: 0 18px 50px rgba(0,0,0,.3); }
body.dark .hero h1 em { -webkit-text-stroke-color: var(--ink); }
body.dark .command-hint, body.dark .site-card { background: rgba(255,255,255,.018); }
body.dark .danger-button { background: #38231f; border-color: #65372e; color: #ffad9d; }
body.dark .color-swatch { border-color: var(--panel-strong); }
body.dark .site-card:hover { background: var(--panel-strong); }

@media (max-width: 1120px) { .site-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .main-content { grid-column: 1; padding: 0 24px 35px; }
  .mobile-only { display: grid; }
  .brand-row .icon-button { border-color: #3d463e; color: #fff; }
  .overlay { position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.4); }
  .overlay.open { display: block; }
  .topbar { height: 72px; }
  .today { display: none; }
  .top-actions { margin-left: auto; }
  .hero { padding: 65px 0 65px; }
  .site-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .main-content { padding-inline: 16px; }
  .command-hint span, .command-hint kbd { display: none; }
  .command-hint { width: 40px; padding: 0; justify-content: center; }
  .hero h1 { font-size: 47px; }
  .hero > p { font-size: 13px; }
  .search-box { height: 60px; }
  .search-icon { display: none; }
  .engine-button { min-width: 58px; margin-left: 8px; }
  .quick-keys { justify-content: space-between; gap: 8px; }
  .quick-keys span:last-child { display: none; }
  .section-heading { align-items: center; }
  .heading-actions .text-button { display: none; }
  .primary-button { padding-inline: 11px; }
  .site-grid { grid-template-columns: 1fr; }
  .site-card { min-height: 132px; }
  .card-actions { opacity: 1; }
  .focus-panel { align-items: stretch; flex-direction: column; }
  .focus-panel::before { right: -20px; top: 80px; font-size: 75px; }
  .clock-card { flex-basis: auto; min-height: 120px; }
  footer { display: grid; gap: 7px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .modal-actions { grid-template-columns: auto 1fr auto; }
  .modal-actions > span { display: none; }
  .modal-actions .primary-button { grid-column: span 3; }
}
