:root {
  --bg: #f4f1ea;
  --ink: #171717;
  --muted: #6d6a63;
  --line: #d8d1c4;
  --panel: #fffdf7;
  --accent: #0f766e;
  --accent-strong: #0b4f4a;
  --warn: #b42318;
  --gold: #c8912a;
  --shadow: 0 20px 70px rgba(31, 28, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.11), transparent 32%),
    linear-gradient(315deg, rgba(200, 145, 42, 0.15), transparent 30%),
    var(--bg);
  font-family: Cambria, Georgia, serif;
}

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

.status-bar,
.current,
.history {
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.88);
  box-shadow: var(--shadow);
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  border-radius: 8px 8px 0 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-family: "Segoe UI", Verdana, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

h2 {
  font-size: 22px;
}

.sync {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  justify-content: flex-end;
  color: var(--muted);
  font-family: "Segoe UI", Verdana, sans-serif;
  font-size: 14px;
}

.sync-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.12);
}

.sync-dot.error {
  background: var(--warn);
  box-shadow: 0 0 0 8px rgba(180, 35, 24, 0.12);
}

.current {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: 330px;
  align-items: stretch;
  border-top: 0;
}

.current-copy {
  padding: 42px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.password {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(82px, 17vw, 210px);
  line-height: 0.86;
  letter-spacing: 0;
  color: var(--ink);
}

.current-details {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-family: "Segoe UI", Verdana, sans-serif;
}

.current-details div {
  display: grid;
  gap: 2px;
}

.current-details span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.current-details strong {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 600;
}

.current-meta {
  border-left: 1px solid var(--line);
  background: #002f41;
  color: #fffdf7;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}

.current-meta span {
  color: rgba(255, 253, 247, 0.72);
  font-family: "Segoe UI", Verdana, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
}

.current-meta strong {
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1;
}

.history {
  margin-top: 18px;
  border-radius: 8px;
  overflow: hidden;
}

.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}

.history-head span {
  color: var(--muted);
  font-family: "Segoe UI", Verdana, sans-serif;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", Verdana, sans-serif;
}

th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--accent-strong);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 15px;
}

tbody tr:nth-child(even) {
  background: rgba(15, 118, 110, 0.05);
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .status-bar,
  .history-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .sync {
    justify-content: flex-start;
    min-width: 0;
  }

  .current {
    grid-template-columns: 1fr;
  }

  .current-copy {
    align-items: center;
    min-height: 250px;
    padding: 36px 22px 32px;
    text-align: center;
  }

  .password {
    width: 100%;
    font-size: clamp(64px, 18vw, 86px);
    line-height: 0.9;
  }

  .current-meta {
    border-left: 0;
    align-items: center;
    min-height: 132px;
    padding: 28px 22px;
    text-align: center;
  }

  .current-meta strong {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(26px, 7vw, 34px);
  }

  th,
  td {
    padding: 14px 12px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 29px;
  }

  h2 {
    font-size: 22px;
  }

  .history-head {
    padding: 22px 26px;
  }

  table {
    table-layout: fixed;
  }

  th,
  td {
    padding: 12px 8px;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 22%;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 27%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 24%;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 27%;
  }
}
