:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f4f7fb;
  background: #090b10;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: rgba(23, 27, 36, .78);
  --surface-2: #171b24;
  --line: rgba(255, 255, 255, .09);
  --muted: #9ea7b7;
  --red: #e82127;
  --focus: #8fb4ff;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: #090b10; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% -10%, rgba(77, 94, 143, .28), transparent 35%), radial-gradient(circle at 5% 25%, rgba(232, 33, 39, .12), transparent 25%), #090b10; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.shell { width: min(1500px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 38px 32px; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 92px; padding: 16px 0; background: linear-gradient(#090b10 70%, transparent); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #f4f7fb; color: #090b10; font-size: 28px; font-weight: 900; box-shadow: inset 0 -5px 0 var(--red); }
.brand strong { font-size: 20px; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.button, .icon-button { border: 1px solid var(--line); color: inherit; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 16px; background: var(--surface-2); font-weight: 720; }
.button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.18); }
.button.primary { border-color: transparent; background: #f4f7fb; color: #090b10; }
.button.ghost { background: transparent; }
.theater-button { background: linear-gradient(145deg, #2d3444, #1b202b); }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 14px; background: transparent; }
.icon-button.large { width: 52px; height: 52px; background: var(--surface-2); }
.icon-button:hover { background: rgba(255,255,255,.08); }
.icon-button.is-favorite { color: #ffd666; }
.icon-button.danger:hover { color: #ff8388; }
.toolbar { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: rgba(14, 17, 23, .82); }
.search-box { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 240px; height: 54px; padding: 0 16px; border: 1px solid var(--line); border-radius: 15px; background: #10131a; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; color: #f4f7fb; background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #717a89; }
.category-tabs { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button { min-height: 46px; padding: 0 16px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; white-space: nowrap; }
.category-tabs button.active { background: #f4f7fb; color: #090b10; }
.content-section { padding-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.section-heading small { color: var(--muted); }
.app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.favorite-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-card { position: relative; display: flex; min-height: 142px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(31,36,47,.92), rgba(18,21,28,.92)); transition: transform .16s ease, border-color .16s ease; }
.app-card::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); content: ''; }
.app-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.app-main { display: flex; flex: 1; align-items: center; gap: 15px; min-width: 0; padding: 22px 10px 22px 23px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.app-icon, .history-icon { display: grid; place-items: center; flex: 0 0 auto; width: 58px; height: 58px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 24%, #12151b); color: white; font-size: 22px; font-weight: 900; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.app-copy { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.app-copy strong { overflow: hidden; font-size: 18px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.app-copy small { display: -webkit-box; overflow: hidden; color: var(--muted); line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.app-actions { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding-right: 10px; }
.empty-state { display: grid; min-height: 240px; place-items: center; align-content: center; border: 1px dashed var(--line); border-radius: 22px; color: var(--muted); text-align: center; }
.empty-state h3 { margin: 10px 0 0; color: #f4f7fb; }
.empty-state p { margin: 6px 0 0; }
.empty-state.compact { min-height: 150px; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.72); backdrop-filter: blur(12px); }
.modal { width: min(560px, 100%); max-height: min(820px, calc(100vh - 48px)); overflow: auto; border: 1px solid rgba(255,255,255,.13); border-radius: 24px; background: #12151c; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); background: rgba(18,21,28,.96); backdrop-filter: blur(12px); }
.modal-header h2 { margin: 0; font-size: 22px; }
.form, .settings-panel { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.form label, .settings-panel > label { display: flex; flex-direction: column; gap: 9px; color: #d9deea; font-size: 14px; font-weight: 700; }
.form input, .form select, .settings-panel select { width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; outline: none; background: #090b10; color: #f4f7fb; }
.form-note { margin: -4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.form-note code { color: #ffc0c2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.history-list { display: flex; flex-direction: column; padding: 12px; }
.history-list > button { display: flex; align-items: center; gap: 14px; min-height: 74px; padding: 10px 12px; border: 0; border-radius: 16px; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.history-list > button:hover { background: rgba(255,255,255,.06); }
.history-list .history-icon { width: 48px; height: 48px; border: 0; border-radius: 14px; }
.history-list button span:nth-child(2) { display: flex; flex-direction: column; gap: 4px; }
.history-list small { color: var(--muted); }
.history-list .text-danger { justify-content: center; color: #ff8388; }
.switch-row { flex-direction: row !important; align-items: center; justify-content: space-between; gap: 20px; }
.switch-row span { display: flex; flex-direction: column; gap: 4px; }
.switch-row small { color: var(--muted); font-weight: 400; }
.switch-row input { width: 25px; height: 25px; accent-color: var(--red); }
.settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.danger-button { color: #ff8f93; background: rgba(232,33,39,.08); }
.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; max-width: min(440px, calc(100vw - 48px)); padding: 16px 20px; border: 1px solid rgba(255,255,255,.14); border-radius: 15px; background: #eef2f8; color: #0a0d12; font-weight: 700; box-shadow: 0 20px 70px rgba(0,0,0,.45); }
@media (max-width: 1050px) {
  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .favorite-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { align-items: stretch; flex-direction: column; }
}
@media (max-width: 760px) {
  .shell { padding: 0 18px 24px; }
  .topbar { min-height: 76px; }
  .theater-button { width: 52px; padding: 0; font-size: 0; }
  .app-grid, .favorite-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-card { min-height: 126px; }
  .app-main { align-items: flex-start; flex-direction: column; }
  .app-actions { position: absolute; top: 8px; right: 4px; }
}
@media (max-width: 480px) {
  .top-actions .icon-button.large:first-of-type { display: none; }
  .brand-mark { width: 45px; height: 45px; border-radius: 13px; }
  .app-grid, .favorite-grid { grid-template-columns: 1fr; }
  .app-card { min-height: 112px; }
  .app-main { align-items: center; flex-direction: row; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.button-symbol { font-size: 25px; line-height: 1; }
.icon-button { font-size: 23px; font-weight: 700; }
.search-box > span { font-size: 24px; }
.empty-icon { font-size: 42px; }
.app-icon { background: color-mix(in srgb, var(--accent) 24%, #12151b); }
.modal-backdrop[hidden], [hidden] { display: none !important; }
.inline-form-error { margin: -8px 0 0; color: #ff989c; font-size: 13px; }
.settings-panel hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.settings-panel .about { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.history-list .text-danger { color: #ff8388; }
@media (max-width: 760px) { .theater-button .button-label { display: none; } }
