:root {
  --ink: #171717;
  --muted: #6e6961;
  --paper: #f6f0e6;
  --surface: #fffdf8;
  --surface-2: #ebe3d5;
  --line: #ddd3c3;
  --accent: #1f6b54;
  --accent-strong: #184b3c;
  --danger: #9a3d35;
  --success: #2f6b4f;
  --shadow: 0 18px 54px rgba(39, 35, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(31, 107, 84, 0.10), transparent 30%),
    linear-gradient(315deg, rgba(154, 61, 53, 0.08), transparent 24%),
    var(--paper);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand-lockup,
.session-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup {
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #8f6b3b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.session-nav {
  color: var(--muted);
  font-size: 14px;
}

.session-pill {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 48px;
}

.intro-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 28px;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
}

h1 {
  max-width: 700px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.96;
}

h2 {
  font-size: 28px;
  line-height: 1.08;
}

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

.analyze-panel,
.result-panel,
.login-panel {
  border: 1px solid rgba(23, 23, 23, 0.10);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
}

.analyze-panel {
  padding: 22px;
}

.analyze-form label,
.login-form span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fffefa;
  color: var(--ink);
  font: inherit;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 107, 84, 0.14);
}

button {
  font: inherit;
}

.primary-button,
.ghost-button,
.download-button {
  height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ghost-button {
  border: 1px solid var(--line);
  padding: 0 16px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink);
}

.notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #eee7da;
  color: var(--muted);
  font-size: 14px;
}

.notice.error {
  background: rgba(154, 61, 53, 0.12);
  color: var(--danger);
}

.notice.success {
  background: rgba(47, 107, 79, 0.12);
  color: var(--success);
}

.result-panel {
  margin-top: 18px;
  min-height: 430px;
  overflow: hidden;
}

.empty-state {
  max-width: 540px;
  padding: 54px;
}

.empty-state p:last-child {
  line-height: 1.6;
}

.result-content {
  padding: 24px;
}

.media-summary {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.media-thumb {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 107, 84, 0.28), rgba(154, 61, 53, 0.12)),
    #d8cebd;
  background-position: center;
  background-size: cover;
}

.format-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 14px;
}

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

.segment {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: #fffdf8;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.segment.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td strong {
  display: block;
  margin-bottom: 4px;
}

td span {
  color: var(--muted);
  font-size: 13px;
}

code {
  padding: 4px 7px;
  border-radius: 6px;
  background: #eee7da;
}

.download-button {
  width: 86px;
  height: 36px;
  background: #eee5d7;
  color: var(--ink);
}

.empty-row {
  padding: 30px 10px;
  color: var(--muted);
  text-align: center;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(460px, 100%);
}

.login-panel {
  padding: 30px;
}

.login-panel h1 {
  margin-top: 26px;
  font-size: 48px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

@media (max-width: 760px) {
  .topbar,
  .intro-panel,
  .format-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .url-row,
  .media-summary {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 44px;
  }

  .empty-state,
  .result-content,
  .analyze-panel {
    padding: 18px;
  }
}

