:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #69746d;
  --line: #dfe5dc;
  --accent: #176b5b;
  --accent-strong: #0f4b40;
  --blue: #2f5f9f;
  --amber: #9b6b17;
  --danger: #a23b3b;
  --shadow: 0 8px 24px rgba(23, 33, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: #eef3ee;
  color: var(--ink);
}

button.secondary:hover {
  background: #dfe8df;
}

button.danger {
  background: #f4e8e8;
  color: var(--danger);
}

button.danger:hover {
  background: #ead5d5;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.session-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.auth-grid,
.workspace {
  display: grid;
  gap: 16px;
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel.compact {
  padding: 14px;
}

.panel h2,
.toolbar h2,
.dialog-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-heading,
.toolbar,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.content {
  display: grid;
  gap: 14px;
  align-content: start;
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.pill {
  border-radius: 999px;
  background: #e7f2ef;
  color: var(--accent-strong);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.plan-list,
.store-list,
.email-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.plan-item,
.store-item,
.email-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.plan-item.current {
  border-color: rgba(23, 107, 91, 0.5);
  background: #f7fbf9;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.name {
  font-weight: 700;
}

.price {
  color: var(--blue);
  font-weight: 700;
}

.search {
  margin-top: 12px;
}

.store-item .meta,
.email-item .meta {
  color: var(--muted);
  font-size: 12px;
}

.email-item {
  cursor: pointer;
}

.email-item:hover {
  border-color: rgba(47, 95, 159, 0.45);
}

.summary {
  color: var(--amber);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.email-dialog {
  width: min(980px, calc(100vw - 28px));
  height: min(760px, calc(100vh - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.email-dialog::backdrop {
  background: rgba(23, 33, 27, 0.35);
}

.dialog-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 34px;
  padding: 0;
  background: #eef3ee;
  color: var(--ink);
}

#email-frame {
  width: 100%;
  height: calc(100% - 82px);
  border: 0;
  background: #fff;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 680px);
    padding-top: 14px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .auth-grid,
  .workspace {
    grid-template-columns: 1fr;
  }
}
