/* Sadik Browser — a Chrome-like browser shell built from scratch.
   No external fonts or assets. */

:root {
  --chrome-bg: #d8dee5;
  --chrome-bg-soft: #e4e9ee;
  --surface: #ffffff;
  --surface-alt: #f1f3f5;
  --surface-strong: #e8ecf0;
  --content-bg: #f7f8fa;
  --hover: rgba(15, 23, 42, 0.06);
  --hover-strong: rgba(15, 23, 42, 0.1);
  --line: rgba(15, 23, 42, 0.11);
  --line-strong: rgba(15, 23, 42, 0.2);
  --text: #1b1f24;
  --text-2: #59616b;
  --text-3: #7d858f;
  --accent: #0f766e;
  --accent-strong: #0b5f58;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-line: rgba(15, 118, 110, 0.3);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.09);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.09);
  --tab-inactive: #cbd2da;
  --tab-hover: #d4dbe3;
  --code-bg: #f0f2f4;
  --scrim: rgba(10, 15, 24, 0.42);
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.13);
  --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.24);
  --reader-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --chrome-bg: #1d1f22;
  --chrome-bg-soft: #24262a;
  --surface: #292b2f;
  --surface-alt: #33363b;
  --surface-strong: #3a3d42;
  --content-bg: #17181b;
  --hover: rgba(255, 255, 255, 0.065);
  --hover-strong: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.19);
  --text: #e9ebee;
  --text-2: #b2b7bf;
  --text-3: #8c939c;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-contrast: #062b27;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.34);
  --danger: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.11);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.1);
  --tab-inactive: #27292d;
  --tab-hover: #303338;
  --code-bg: #202226;
  --scrim: rgba(0, 0, 0, 0.58);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.48);
  --reader-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--chrome-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.browser {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 320px;
  background: var(--content-bg);
}

/* ------------------------------------------------------------------ tabs */

.tabstrip {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 4px;
  height: 40px;
  padding: 6px 8px 0;
  background: var(--chrome-bg);
  user-select: none;
}

.tabstrip-scroll {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tabstrip-scroll::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 212px;
  min-width: 108px;
  max-width: 238px;
  height: 34px;
  margin: 0;
  padding: 0 7px 0 10px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: var(--tab-inactive);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1;
  text-align: left;
  overflow: hidden;
  transition: background 0.14s ease, color 0.14s ease;
}

.tab:hover {
  background: var(--tab-hover);
  color: var(--text);
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.tab-favicon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--c, #64748b);
  color: var(--tc, #ffffff);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  overflow: hidden;
}

.tab-favicon .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

.tab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  opacity: 0;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

.tab:hover .tab-close,
.tab.is-active .tab-close,
.tab:focus-within .tab-close {
  opacity: 1;
}

.tab-close:hover {
  background: var(--hover-strong);
  color: var(--text);
}

.tab-close .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.new-tab-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-bottom: 3px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  transition: background 0.13s ease, color 0.13s ease;
}

.new-tab-btn:hover {
  background: var(--hover-strong);
  color: var(--text);
}

.new-tab-btn .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.1;
}

.tabstrip-spacer {
  flex: 1;
  min-width: 4px;
}

.profile-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  margin-bottom: 4px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: linear-gradient(145deg, #0f766e, #14b8a6 62%, #fbbf24);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 2px 6px rgba(15, 23, 42, 0.18);
}

.profile-btn span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------- toolbar */

.toolbar {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  padding: 6px 10px 7px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
}

.tool-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  transition: background 0.13s ease, color 0.13s ease, transform 0.08s ease;
}

.tool-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.tool-btn:active {
  transform: scale(0.94);
}

.tool-btn:disabled {
  opacity: 0.32;
  background: transparent;
  color: var(--text-2);
  transform: none;
}

.tool-btn .icon {
  width: 17px;
  height: 17px;
}

.omnibox-wrap {
  position: relative;
  flex: 1;
  min-width: 80px;
}

.omnibox {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 5px 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-alt);
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.omnibox:hover {
  border-color: var(--line);
}

.omnibox:focus-within {
  background: var(--surface);
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.omnibox-site {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.omnibox-site .icon {
  width: 14px;
  height: 14px;
  stroke-width: 1.9;
}

.omnibox-site.is-secure {
  color: var(--accent);
}

.omnibox-site.is-insecure {
  color: var(--amber);
}

.omnibox input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.omnibox input::placeholder {
  color: var(--text-3);
}

.omnibox-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  transition: background 0.12s ease, color 0.12s ease;
}

.omnibox-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.omnibox-btn:disabled {
  opacity: 0.28;
  background: transparent;
}

.omnibox-btn .icon {
  width: 15px;
  height: 15px;
}

.omnibox-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.omnibox-btn.is-saved {
  color: #d97706;
}

html[data-theme="dark"] .omnibox-btn.is-saved {
  color: #fbbf24;
}

.toolbar-end {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
}

/* ----------------------------------------------------------- suggestions */

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 120;
  max-height: min(420px, 58vh);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: pop-in 0.12s ease both;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.suggestion:hover,
.suggestion.is-active {
  background: var(--hover);
}

.suggestion-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-2);
}

.suggestion-icon .icon {
  width: 14px;
  height: 14px;
}

.suggestion-text {
  flex: 1;
  min-width: 0;
}

.suggestion-text strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-text span {
  display: block;
  overflow: hidden;
  color: var(--text-3);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-type {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------- bookmarks */

.bookmarks-bar {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
  height: 34px;
  padding: 0 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.bookmarks-apps {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
}

.bookmarks-apps:hover {
  background: var(--hover);
  color: var(--text);
}

.bookmarks-apps .icon {
  width: 14px;
  height: 14px;
}

.bookmark-items {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.bookmark-items::-webkit-scrollbar {
  display: none;
}

.bookmark-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  max-width: 190px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 11.5px;
  white-space: nowrap;
}

.bookmark-chip:hover {
  background: var(--hover);
  color: var(--text);
}

.bookmark-chip .favicon {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  font-size: 7px;
}

.bookmark-chip .label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmarks-empty {
  padding: 0 7px;
  color: var(--text-3);
  font-size: 10.5px;
  white-space: nowrap;
}

.bookmarks-all {
  flex: 0 0 auto;
  height: 25px;
  margin-left: auto;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font-size: 10.5px;
  white-space: nowrap;
}

.bookmarks-all:hover {
  background: var(--hover);
  color: var(--text);
}

/* ---------------------------------------------------------------- content */

.content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--content-bg);
}

.page-host {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.page-host::-webkit-scrollbar {
  width: 10px;
}

.page-host::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 99px;
  background: var(--line-strong);
  background-clip: content-box;
}

.loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

.loading-bar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent), #fbbf24, transparent);
  animation: loading-sweep 1.15s ease-in-out infinite;
}

@keyframes loading-sweep {
  from {
    left: -45%;
  }
  to {
    left: 105%;
  }
}

.status-pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 60;
  max-width: min(70vw, 560px);
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(32, 33, 36, 0.92);
  color: #e8eaed;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 90;
  max-width: min(90vw, 440px);
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  text-align: center;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  animation: toast-in 0.16s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 5px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ------------------------------------------------------------------ menu */

.menu {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 100;
  width: 272px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.13s ease both;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
}

.menu-item:hover {
  background: var(--hover);
}

.menu-item:disabled {
  opacity: 0.4;
  background: transparent;
}

.menu-item .icon {
  width: 15px;
  height: 15px;
  color: var(--text-2);
}

.menu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-shortcut {
  flex: 0 0 auto;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 9px;
}

.menu-check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent);
  visibility: hidden;
}

.menu-item.is-checked .menu-check {
  visibility: visible;
}

.menu-check .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
  stroke-width: 2.4;
}

.menu-sep {
  height: 1px;
  margin: 5px 8px;
  background: var(--line);
}

.menu-item.danger,
.menu-item.danger .icon {
  color: var(--danger);
}

/* --------------------------------------------------------- original view */

.original-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--content-bg);
}

.original-banner {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
}

.original-banner-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.original-banner-icon .icon {
  width: 14px;
  height: 14px;
}

.original-banner p {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.45;
}

.original-banner strong {
  color: var(--text);
  font-weight: 600;
}

.original-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 10.5px;
  white-space: nowrap;
}

.mini-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.mini-btn .icon {
  width: 11px;
  height: 11px;
}

.frame-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #ffffff;
}

.frame-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.frame-fallback {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 22px;
  background: var(--content-bg);
  overflow: auto;
}

/* --------------------------------------------------------------- new tab */

.ntp {
  position: relative;
  min-height: 100%;
  padding: clamp(30px, 5vh, 58px) clamp(16px, 4vw, 30px) 44px;
  overflow: hidden;
}

.ntp::before {
  content: "";
  position: absolute;
  inset: -25% -15% auto;
  height: 560px;
  background:
    radial-gradient(500px 300px at 18% 20%, var(--accent-soft), transparent 68%),
    radial-gradient(520px 300px at 86% 8%, rgba(251, 191, 36, 0.1), transparent 62%);
  pointer-events: none;
}

.ntp-inner {
  position: relative;
  z-index: 1;
  max-width: 950px;
  margin: 0 auto;
}

.ntp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(28px, 6vh, 54px);
}

.ntp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: 0.005em;
}

.ntp-brand strong {
  color: var(--text);
  font-weight: 680;
}

.logo-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  border-radius: 10px;
  background: linear-gradient(140deg, #0f766e, #14b8a6 56%, #fbbf24);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 16px rgba(15, 118, 110, 0.22);
}

.logo-mark .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.7;
}

.ntp-badge {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-3);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ntp-date {
  color: var(--text-3);
  font-size: 10.5px;
  white-space: nowrap;
}

.ntp-hero {
  margin-bottom: 25px;
}

.ntp h1 {
  max-width: 780px;
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(2.25rem, 5.4vw, 3.7rem);
  font-weight: 730;
  letter-spacing: -0.048em;
  line-height: 1.03;
}

.ntp h1 em {
  display: inline-block;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--accent) 8%, #f59e0b 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ntp-sub {
  max-width: 590px;
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.68;
}

.ntp-search-wrap {
  position: relative;
  max-width: 730px;
}

.ntp-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 8px 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.ntp-search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 14px 36px rgba(15, 23, 42, 0.08);
}

.ntp-search > .icon {
  width: 19px;
  height: 19px;
  color: var(--text-3);
}

.ntp-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.ntp-search input::placeholder {
  color: var(--text-3);
}

.ntp-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 12.5px;
  font-weight: 650;
  transition: background 0.13s ease, transform 0.08s ease;
}

.ntp-search-btn:hover {
  background: var(--accent-strong);
}

html[data-theme="dark"] .ntp-search-btn:hover {
  background: #5eead4;
}

.ntp-search-btn:active {
  transform: scale(0.98);
}

.ntp-search-btn .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.1;
}

.ntp-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.ntp-chips-label {
  margin-right: 2px;
  color: var(--text-3);
  font-size: 10px;
}

.chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 10.5px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.chip:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.ntp-section {
  margin-top: clamp(28px, 5vh, 42px);
}

.ntp-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.ntp-section-head h2 {
  margin: 0;
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.ntp-section-head button {
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 10.5px;
}

.ntp-section-head button:hover {
  color: var(--accent-strong);
}

.shortcuts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px 6px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  transition: background 0.13s ease, border-color 0.13s ease, transform 0.13s ease;
}

.shortcut:hover {
  border-color: var(--line);
  background: var(--surface);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.shortcut-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--c, #64748b);
  color: var(--tc, #ffffff);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 4px 10px rgba(15, 23, 42, 0.12);
}

.shortcut-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.recent-item:first-child {
  border-top: 0;
}

.recent-item:hover {
  background: var(--hover);
}

.recent-item .favicon {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  font-size: 9.5px;
}

.recent-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.recent-text strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-text span {
  overflow: hidden;
  color: var(--text-3);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-time {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ntp-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 13px;
  margin-top: 36px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 10px;
}

.ntp-foot button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 10px;
}

.ntp-foot button:hover {
  color: var(--accent-strong);
}

.ntp-foot .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* ---------------------------------------------------------- internal pages */

.internal-page {
  max-width: 990px;
  margin: 0 auto;
  padding: clamp(28px, 4.6vw, 52px) clamp(16px, 4vw, 34px) 80px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-bottom: 23px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.8rem, 3.5vw, 2.55rem);
  font-weight: 710;
  letter-spacing: -0.042em;
  line-height: 1.08;
}

.page-sub {
  max-width: 650px;
  margin: 9px 0 0;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
}

.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover {
  background: var(--hover);
  color: var(--text);
}

.btn .icon {
  width: 13px;
  height: 13px;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: var(--accent-contrast);
}

html[data-theme="dark"] .btn.primary:hover {
  border-color: #5eead4;
  background: #5eead4;
  color: var(--accent-contrast);
}

.btn.danger {
  border-color: rgba(180, 35, 24, 0.26);
  color: var(--danger);
}

.btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.btn:disabled:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
}

.btn.danger:disabled:hover {
  border-color: rgba(180, 35, 24, 0.26);
  background: transparent;
  color: var(--danger);
}

.row-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.row-btn:disabled:hover {
  background: transparent;
  color: var(--text-3);
}

/* ---------------------------------------------------------------- history */

.history-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 220px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.filter-field:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-field .icon {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}

.filter-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.filter-field input::placeholder {
  color: var(--text-3);
}

.history-count {
  color: var(--text-3);
  font-size: 10.5px;
  white-space: nowrap;
}

.history-group {
  margin-bottom: 22px;
}

.history-group h2 {
  margin: 0 0 6px;
  padding: 0 4px;
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.history-list {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  list-style: none;
  overflow: hidden;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.history-row:first-child {
  border-top: 0;
}

.history-row:hover {
  background: var(--hover);
}

.history-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.history-link strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-link span {
  overflow: hidden;
  color: var(--text-3);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-time {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-3);
}

.row-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.row-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.row-btn .icon {
  width: 14px;
  height: 14px;
}

.row-btn.is-saved {
  color: #d97706;
}

html[data-theme="dark"] .row-btn.is-saved {
  color: #fbbf24;
}

.favicon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--c, #64748b);
  color: var(--tc, #ffffff);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
}

.favicon .icon {
  width: 14px;
  height: 14px;
  stroke-width: 1.9;
}

.favicon-lg {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 13px;
}

.favicon-muted {
  background: var(--surface-alt);
  color: var(--text-2);
}

/* -------------------------------------------------------------- bookmarks */

.bookmark-form {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
  margin-bottom: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field label {
  color: var(--text-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input::placeholder {
  color: var(--text-3);
}

.bookmark-form .btn {
  margin-top: 18px;
  min-height: 38px;
}

.form-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger);
  font-size: 11px;
}

.bookmark-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.bookmark-row:first-child {
  border-top: 0;
}

.bookmark-row:hover {
  background: var(--hover);
}

.bookmark-row .history-link strong {
  font-size: 12.5px;
}

.empty-state {
  padding: 54px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--text-3);
  text-align: center;
}

.empty-state .icon {
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  color: var(--text-3);
}

.empty-state h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  font-size: 11.5px;
}

/* --------------------------------------------------------------- settings */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.settings-card {
  min-width: 0;
  padding: 19px 21px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.settings-card h2 {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-sub {
  margin: 0 0 9px;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.55;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.setting-row:first-of-type {
  border-top: 0;
}

.setting-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.setting-text strong {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 550;
}

.setting-text span {
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.5;
}

.segmented {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-alt);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.13);
}

.segmented .icon {
  width: 12px;
  height: 12px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--line-strong);
  transition: background 0.16s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.32);
  transition: transform 0.16s ease;
}

.switch[aria-checked="true"] {
  background: var(--accent);
}

.switch[aria-checked="true"]::after {
  transform: translateX(16px);
}

.data-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 11px 0 13px;
}

.data-stat {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-alt);
}

.data-stat strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.data-stat span {
  display: block;
  margin-top: 1px;
  color: var(--text-3);
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.service-line {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.service-line:first-of-type {
  border-top: 0;
}

.service-line .favicon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 8px;
}

.service-line strong {
  color: var(--text);
  font-weight: 600;
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-note {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.65;
}

.settings-note strong {
  color: var(--text);
  font-weight: 600;
}

/* ------------------------------------------------------------------ about */

.about-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(80% 120% at 100% 0%, var(--accent-soft), transparent 58%),
    var(--surface);
}

.about-hero .logo-mark {
  width: 58px;
  height: 58px;
  border-radius: 17px;
}

.about-hero .logo-mark .icon {
  width: 30px;
  height: 30px;
}

.about-hero-text {
  min-width: 0;
}

.about-hero h1 {
  margin: 0 0 5px;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 710;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.about-hero p {
  max-width: 650px;
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.65;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin: 13px 0;
}

.about-card {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.about-card > .icon {
  width: 20px;
  height: 20px;
  margin-bottom: 9px;
  color: var(--accent-strong);
}

.about-card h2 {
  margin: 0 0 5px;
  font-size: 12.5px;
  font-weight: 650;
}

.about-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.62;
}

.about-section {
  margin-top: 13px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.about-section h2 {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 650;
}

.about-section > p {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.65;
}

.about-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.7;
}

.about-list li {
  margin: 0.28em 0;
}

.about-list strong {
  color: var(--text);
  font-weight: 600;
}

.about-limits {
  border-color: rgba(180, 83, 9, 0.26);
  background: var(--amber-soft);
}

html[data-theme="dark"] .about-limits {
  border-color: rgba(251, 191, 36, 0.22);
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 4px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-alt);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.credit-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
}

.credit-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.credit-row span {
  color: var(--text-2);
}

.credit-row a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
  white-space: nowrap;
}

.credit-row a:hover {
  text-decoration-color: currentColor;
}

.about-meta {
  margin-top: 16px;
  color: var(--text-3);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- search */

.search-page {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px) clamp(14px, 4vw, 30px) 80px;
}

.search-top {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.search-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.search-brand .logo-mark {
  width: 29px;
  height: 29px;
  border-radius: 9px;
}

.search-brand .logo-mark .icon {
  width: 16px;
  height: 16px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 5px 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.search-form:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-form > .icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.search-form button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-contrast);
}

.search-form button .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.1;
}

.search-heading {
  margin: 17px 0 12px;
}

.search-heading h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.search-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 5px 0 0;
  color: var(--text-3);
  font-size: 10.5px;
}

.search-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.result-list {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.result {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.result:first-child {
  border-top: 0;
}

.result:hover {
  background: var(--hover);
}

.result-favicon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--c, #64748b);
  color: var(--tc, #ffffff);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
}

.result-body {
  flex: 1;
  min-width: 0;
}

.result-url {
  overflow: hidden;
  color: var(--text-3);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-title {
  display: inline-block;
  margin: 2px 0 5px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.32;
  overflow-wrap: break-word;
}

.result-title:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
}

.result-snippet {
  max-width: 700px;
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.58;
  overflow-wrap: break-word;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.result:hover .result-actions,
.result:focus-within .result-actions {
  opacity: 1;
}

.result-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font-size: 9.5px;
}

.result-action:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.result-action .icon {
  width: 10px;
  height: 10px;
}

/* ----------------------------------------------------------------- reader */

.reader-page {
  max-width: 870px;
  margin: 0 auto;
  padding: 18px clamp(10px, 3vw, 28px) 80px;
}

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  margin-bottom: 10px;
  background: var(--content-bg);
  border-bottom: 1px solid transparent;
}

.reader-source {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.reader-source .favicon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 10px;
}

.reader-source-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.reader-domain {
  overflow: hidden;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-date {
  overflow: hidden;
  color: var(--text-3);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-top-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
}

.reader-top-actions .mini-btn {
  background: var(--surface);
}

.article {
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--reader-shadow);
}

.article-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 20px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 83, 9, 0.24);
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--text-2);
  font-size: 10.5px;
  line-height: 1.55;
}

html[data-theme="dark"] .article-banner {
  border-color: rgba(251, 191, 36, 0.22);
}

.article-banner .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--amber);
}

.article-banner strong {
  color: var(--text);
  font-weight: 600;
}

.reader-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.reader-header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.65rem, 3.6vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 1.14;
  overflow-wrap: break-word;
}

.reader-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 11px;
  color: var(--text-3);
  font-size: 10px;
}

.reader-byline span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.reader-byline .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.reader-body {
  color: var(--text);
  font-size: 16.5px;
  line-height: 1.72;
  overflow-wrap: break-word;
}

.reader-body > *:first-child {
  margin-top: 0;
}

.reader-body > *:last-child {
  margin-bottom: 0;
}

.reader-body h1,
.reader-body h2,
.reader-body h3,
.reader-body h4,
.reader-body h5,
.reader-body h6 {
  margin: 1.55em 0 0.55em;
  color: var(--text);
  font-weight: 660;
  letter-spacing: -0.026em;
  line-height: 1.24;
}

.reader-body h1 {
  font-size: 1.72em;
}

.reader-body h2 {
  font-size: 1.4em;
}

.reader-body h3 {
  font-size: 1.17em;
}

.reader-body h4,
.reader-body h5,
.reader-body h6 {
  font-size: 1.02em;
}

.reader-body p {
  margin: 0 0 1.02em;
}

.reader-body a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
}

.reader-body a:hover {
  text-decoration-color: currentColor;
}

.reader-body strong {
  color: var(--text);
  font-weight: 650;
}

.reader-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2em auto;
  border-radius: 10px;
  background: var(--surface-alt);
}

.reader-body figure {
  margin: 1.3em 0;
}

.reader-body figcaption {
  margin-top: 0.4em;
  color: var(--text-3);
  font-size: 0.75em;
  text-align: center;
}

.reader-body blockquote {
  margin: 1.2em 0;
  padding: 0.15em 0 0.15em 1em;
  border-left: 3px solid var(--accent-line);
  color: var(--text-2);
}

.reader-body blockquote p:last-child {
  margin-bottom: 0;
}

.reader-body pre {
  margin: 1.2em 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  overflow-x: auto;
  font-size: 0.8em;
  line-height: 1.55;
}

.reader-body code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 0.86em;
}

.reader-body pre code {
  padding: 0;
  background: none;
  font-size: 1em;
}

.reader-body ul,
.reader-body ol {
  margin: 0 0 1.02em;
  padding-left: 1.35em;
}

.reader-body li {
  margin: 0.3em 0;
}

.reader-body hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.reader-body table {
  display: block;
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  overflow-x: auto;
  font-size: 0.8em;
}

.reader-body th,
.reader-body td {
  padding: 7px 9px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.reader-body th {
  background: var(--surface-alt);
  font-weight: 650;
}

.reader-body sup,
.reader-body sub {
  font-size: 0.72em;
}

.reader-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.6;
}

.reader-foot p {
  max-width: 580px;
  margin: 0;
}

.reader-foot-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

/* ---------------------------------------------------------------- loading */

.loading-page {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) clamp(16px, 4vw, 28px);
}

.loading-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.loading-head strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.loading-head p {
  margin: 1px 0 0;
  color: var(--text-3);
  font-size: 10.5px;
}

.spinner {
  display: inline-block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.tab-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  border-color: var(--line-strong);
  border-top-color: var(--accent);
}

.loading-head .spinner {
  width: 21px;
  height: 21px;
  border-width: 2.5px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton-card {
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.skeleton-line {
  height: 12px;
  margin-bottom: 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--surface-alt), var(--surface-strong), var(--surface-alt));
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

.skeleton-line.is-title {
  width: 64%;
  height: 28px;
  margin-bottom: 22px;
}

.skeleton-line.is-short {
  width: 38%;
}

.skeleton-line.is-medium {
  width: 78%;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -20% 0;
  }
}

.loading-note {
  margin-top: 16px;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.55;
}

/* ------------------------------------------------------------ state pages */

.state-page {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 36px 20px;
}

.state-card {
  width: 100%;
  max-width: 570px;
  padding: 32px 30px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.state-card.compact {
  max-width: 520px;
  padding: 26px 24px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.state-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 13px;
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
}

.state-icon .icon {
  width: 22px;
  height: 22px;
}

.state-card h1,
.state-card h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  font-weight: 690;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.state-card p {
  max-width: 470px;
  margin: 0 auto 18px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.68;
}

.state-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.state-detail {
  margin-top: 17px;
  color: var(--text-3);
  font-size: 10px;
  text-align: left;
}

.state-card p.state-detail-inline {
  margin: -8px auto 16px;
  color: var(--text-3);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.state-detail summary {
  cursor: pointer;
}

.state-detail pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- dialog */

.confirm-dialog {
  width: calc(100% - 32px);
  max-width: 420px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.confirm-dialog::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  padding: 26px 26px 21px;
  text-align: center;
}

.confirm-dialog .state-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-dialog h2 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.confirm-dialog p {
  margin: 0 0 19px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.65;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.noscript {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 200;
  width: min(90vw, 480px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1024px) {
  .shortcuts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .about-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-card-wide {
    grid-column: auto;
  }

  .about-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tabstrip {
    height: 38px;
    padding: 5px 6px 0;
  }

  .tab {
    height: 33px;
    flex-basis: 176px;
    min-width: 100px;
  }

  .profile-btn {
    display: none;
  }

  .toolbar {
    gap: 3px;
    padding: 5px 6px 6px;
  }

  .tool-btn {
    width: 30px;
    height: 30px;
  }

  .tool-btn-home {
    display: none;
  }

  .omnibox {
    height: 34px;
    padding-left: 10px;
    gap: 6px;
  }

  .omnibox input {
    font-size: 12.5px;
  }

  .omnibox-btn {
    width: 25px;
    height: 25px;
  }

  .bookmarks-bar {
    height: 32px;
    padding: 0 6px;
  }

  .ntp {
    padding-top: 28px;
  }

  .ntp-top {
    margin-bottom: 32px;
  }

  .ntp h1 {
    font-size: clamp(2.05rem, 9vw, 2.8rem);
  }

  .ntp-sub {
    font-size: 12.5px;
  }

  .shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .internal-page {
    padding-top: 28px;
  }

  .bookmark-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .bookmark-form .btn {
    margin-top: 0;
    justify-self: start;
  }

  .about-hero {
    align-items: flex-start;
    padding: 20px;
  }

  .about-hero .logo-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .about-hero .logo-mark .icon {
    width: 25px;
    height: 25px;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .shortcut-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .original-banner {
    flex-wrap: wrap;
    gap: 6px 9px;
    padding: 7px 10px;
  }

  .original-banner p {
    flex: 1 1 220px;
    font-size: 10.5px;
  }

  .original-actions {
    margin-left: 33px;
  }

  .reader-body {
    font-size: 15.5px;
  }

  .article {
    padding: 22px 18px;
  }

  .reader-foot {
    flex-direction: column;
    gap: 10px;
  }

  .search-top {
    flex-wrap: wrap;
  }

  .search-brand {
    width: 100%;
  }

  .search-form {
    flex: 1 1 100%;
  }

  .result-actions {
    opacity: 1;
  }

  .result {
    padding: 14px 13px;
  }
}

@media (max-width: 560px) {
  .tabstrip-scroll {
    gap: 2px;
  }

  .tab {
    flex-basis: 146px;
    min-width: 94px;
    padding-left: 8px;
    gap: 6px;
  }

  .tab-title {
    font-size: 11.5px;
  }

  .new-tab-btn {
    width: 26px;
    height: 26px;
  }

  .nav-group {
    gap: 0;
  }

  .tool-btn {
    width: 28px;
    height: 28px;
  }

  .tool-btn .icon {
    width: 16px;
    height: 16px;
  }

  .omnibox {
    padding-left: 9px;
  }

  .omnibox-site {
    display: none;
  }

  .bookmarks-all {
    display: none;
  }

  .ntp {
    padding: 24px 16px 38px;
  }

  .ntp h1 {
    font-size: clamp(2rem, 10vw, 2.5rem);
  }

  .ntp-search {
    height: 50px;
    padding-left: 14px;
    border-radius: 15px;
  }

  .ntp-search input {
    font-size: 13.5px;
  }

  .ntp-search-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 11.5px;
  }

  .shortcut {
    padding: 9px 4px 8px;
  }

  .shortcut-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 10.5px;
  }

  .shortcut-name {
    font-size: 10px;
  }

  .internal-page {
    padding: 24px 14px 64px;
  }

  .page-heading {
    margin-bottom: 18px;
  }

  .history-time {
    display: none;
  }

  .history-row,
  .bookmark-row {
    gap: 9px;
    padding: 9px 10px;
  }

  .row-btn {
    width: 26px;
    height: 26px;
  }

  .history-tools {
    gap: 7px;
  }

  .history-count {
    display: none;
  }

  .filter-field {
    min-width: 0;
    flex: 1 1 100%;
  }

  .settings-card {
    padding: 17px 16px 15px;
  }

  .setting-row {
    align-items: flex-start;
    gap: 12px;
  }

  .segmented {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .segmented button {
    padding: 5px 7px;
    font-size: 10px;
  }

  .data-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .about-hero {
    flex-direction: column;
    gap: 12px;
  }

  .about-section {
    padding: 17px 16px;
  }

  .search-page {
    padding: 18px 14px 64px;
  }

  .search-heading h1 {
    font-size: 1.35rem;
  }

  .result {
    gap: 9px;
    padding: 13px 11px;
  }

  .result-favicon {
    width: 29px;
    height: 29px;
    border-radius: 8px;
    font-size: 11px;
  }

  .result-title {
    font-size: 14.5px;
  }

  .result-snippet {
    font-size: 11.5px;
  }

  .reader-page {
    padding: 12px 8px 60px;
  }

  .reader-topbar {
    gap: 7px;
    padding: 8px 2px;
  }

  .reader-top-actions .mini-btn span {
    display: none;
  }

  .reader-top-actions .mini-btn {
    padding: 5px 7px;
  }

  .article {
    padding: 19px 15px;
    border-radius: 14px;
  }

  .reader-body {
    font-size: 15px;
    line-height: 1.68;
  }

  .article-banner {
    font-size: 10px;
  }

  .state-card {
    padding: 26px 18px 22px;
  }

  .toast {
    bottom: 14px;
    font-size: 11px;
  }

  .status-pill {
    left: 8px;
    bottom: 8px;
    max-width: calc(100vw - 16px);
  }
}

@media (max-width: 400px) {
  .tabstrip {
    padding-left: 4px;
    padding-right: 4px;
  }

  .tab {
    flex-basis: 132px;
    min-width: 86px;
  }

  .tab-close {
    width: 16px;
    height: 16px;
  }

  .profile-btn {
    display: none;
  }

  .ntp-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .ntp-date {
    display: none;
  }

  .ntp-badge {
    display: none;
  }

  .shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shortcut-icon {
    width: 39px;
    height: 39px;
  }

  .ntp-chips-label {
    flex: 1 1 100%;
  }

  .segmented {
    width: 100%;
    justify-content: space-between;
  }

  .setting-row {
    flex-direction: column;
  }

  .setting-row .segmented,
  .setting-row .switch {
    align-self: flex-end;
  }

  .data-stat strong {
    font-size: 14px;
  }

  .data-stat span {
    font-size: 7.5px;
  }

  .reader-source .favicon {
    width: 24px;
    height: 24px;
  }

  .reader-domain {
    font-size: 10px;
  }
}

@media (hover: none) {
  .tab-close {
    opacity: 1;
  }

  .result-actions {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  body {
    overflow: visible;
    background: #ffffff;
  }

  .tabstrip,
  .toolbar,
  .bookmarks-bar,
  .reader-topbar,
  .reader-foot,
  .loading-bar,
  .status-pill,
  .toast,
  .menu,
  .original-view {
    display: none !important;
  }

  .browser,
  .content,
  .page-host {
    position: static;
    height: auto;
    overflow: visible;
    background: #ffffff;
  }

  .reader-page {
    max-width: none;
    padding: 0;
  }

  .article {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .reader-body {
    color: #111111;
    font-size: 12pt;
  }
}
