:root {
  --bg: #f4f4f4;
  --fg: #0b0d12;
  --muted: rgba(11, 13, 18, 0.6);
  --window: #ffffff;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  --border: rgba(8, 8, 8, 0.08);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

[data-theme='dark'] {
  --bg: #050505;
  --fg: #f5f6f8;
  --muted: rgba(245, 246, 248, 0.65);
  --window: rgba(20, 20, 20, 0.85);
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

[data-accent='blue'] {
  --accent: var(--accent-blue);
}
[data-accent='purple'] {
  --accent: var(--accent-purple);
}
[data-accent='pink'] {
  --accent: var(--accent-pink);
}
[data-accent='orange'] {
  --accent: var(--accent-orange);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.app {
  width: min(1200px, 100%);
  background: var(--window);
  border-radius: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.9),
    rgba(248, 250, 255, 0.85)
  );
}

[data-theme='dark'] .titlebar {
  background: linear-gradient(
    120deg,
    rgba(22, 22, 22, 0.9),
    rgba(12, 12, 12, 0.85)
  );
}

.traffic-lights {
  display: flex;
  gap: 8px;
}

.light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-flex;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.light.close {
  background: #ff5f57;
}
.light.minimize {
  background: #ffbd2e;
}
.light.fullscreen {
  background: #28c840;
}

.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
}

.brand img {
  width: 20px;
  height: 20px;
}

.browser-window {
  display: flex;
  flex-direction: column;
}

.toolbar {
  gap: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.controls {
  display: flex;
  gap: 8px;
}

.control {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  color: var(--fg);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

[data-theme='dark'] .control {
  background: rgba(0, 0, 0, 0.45);
}

.control:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.control:not(:disabled):hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.address-shell {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding-left: 32px;
}

[data-theme='dark'] .address-shell {
  background: rgba(0, 0, 0, 0.45);
}

.https-lock {
  position: absolute;
  left: 12px;
  font-size: 0.85rem;
}

#address-bar {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  font-size: 1rem;
  background: transparent;
  color: var(--fg);
}

#address-bar:focus {
  outline: none;
}

#history-dropdown {
  border: 0;
  border-left: 1px solid var(--border);
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.viewport-shell {
  height: 640px;
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
}

#akaline-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.footer {
  text-align: center;
  padding: 24px 16px 32px;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal[data-open='true'] {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  width: min(420px, 90vw);
  background: var(--window);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-content header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-content h2 {
  margin: 0;
}

.modal-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.setting-group h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.accent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 8px;
}

.accent-swatch {
  height: 40px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--accent);
}

.accent-swatch[data-accent='blue'] {
  background: var(--accent-blue);
}
.accent-swatch[data-accent='purple'] {
  background: var(--accent-purple);
}
.accent-swatch[data-accent='pink'] {
  background: var(--accent-pink);
}
.accent-swatch[data-accent='orange'] {
  background: var(--accent-orange);
}

.settings-control {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.settings-control:hover {
  border-color: transparent;
  transform: translateY(-1px);
}

.modal button {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}

#close-settings {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
}

.home-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #050815, #0f172a);
  color: #fff;
  padding: 40px;
}

.home-card {
  max-width: 560px;
  background: rgba(255, 255, 255, 0.05);
  padding: 32px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.4);
}

.home-logo {
  width: 72px;
  margin-bottom: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.home-card h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.home-card p {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.home-points {
  list-style: none;
  padding: 0;
  margin: 32px 0;
  display: grid;
  gap: 8px;
}

.home-points li {
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 12px;
}

.home-footer {
  margin-top: 24px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 768px) {
  body {
    padding: 8px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .controls {
    justify-content: space-between;
  }

  #history-dropdown {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

