:root {
  color-scheme: light;
  --bg: #f1f5f8;
  --panel: #ffffff;
  --text: #1d2935;
  --muted: #657382;
  --line: #d5dee7;
  --accent: #19c9bf;
  --accent-strong: #087a83;
  --accent-soft: #dff8f5;
  --blue: #315f86;
  --blue-soft: #e6eef5;
  --ink-soft: #edf3f7;
  --danger: #a43825;
  --ok: #167567;
  --shadow: 0 18px 50px rgba(35, 56, 74, 0.10);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #e8f0f6 0, rgba(232, 240, 246, 0) 360px),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--blue);
  color: #ffffff;
  padding: 0 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(49, 95, 134, 0.20);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button:hover {
  background: #244d70;
  border-color: #244d70;
  transform: translateY(-1px);
}

button.secondary {
  background: #ffffff;
  color: var(--blue);
  box-shadow: none;
}

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

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

.topbar {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border: 1px solid rgba(214, 224, 230, 0.8);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(246, 250, 252, 0.93)),
    var(--panel);
  box-shadow: var(--shadow);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(48%, 520px);
  height: 190px;
  background:
    linear-gradient(90deg, rgba(49, 95, 134, 0.20) 1px, transparent 1px),
    linear-gradient(0deg, rgba(25, 201, 191, 0.24) 1px, transparent 1px);
  background-size: 22px 22px;
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
  opacity: 0.75;
  pointer-events: none;
}

.brand-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.brand-logo {
  display: block;
  width: 176px;
  max-width: 52vw;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(35, 56, 74, 0.16));
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  margin: 0;
}

#subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.session {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-label {
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.status-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(24, 44, 55, 0.06);
}

.status-panel.error {
  border-color: #e3b0a5;
  color: var(--danger);
}

.status-icon {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.status-panel.error .status-icon {
  background: var(--danger);
  box-shadow: 0 0 0 5px #f5ded9;
}

.secret-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.secret-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(214, 224, 230, 0.9);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 10px 34px rgba(24, 44, 55, 0.07);
}

.secret-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--blue));
}

.secret-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.secret-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.meta-item {
  min-width: 0;
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.meta-value {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.secret-value {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #c9d8dd;
  border-radius: 6px;
  background: var(--ink-soft);
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.expires {
  color: var(--ok);
}

@media (max-width: 760px) {
  .topbar,
  .secret-card header {
    flex-direction: column;
    align-items: stretch;
  }

  .session {
    justify-content: flex-start;
  }

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