:root {
  --bg: #edf3fb;
  --panel: #ffffff;
  --ink: #132033;
  --muted: #56708f;
  --line: #c9d9ec;
  --accent: rgb(34, 58, 97);
  --accent-dark: #18345d;
  --accent-soft: #dfe9f7;
  --accent-strong: #27477c;
  --success-bg: #edf6ff;
  --success-ink: #1d4f87;
  --error-bg: #fff1f1;
  --error-ink: #b3261e;
  --danger: #c84444;
  --danger-dark: #a33030;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34, 58, 97, 0.18) 0, transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--ink);
}

.page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.hero {
  padding: 12px 0 28px;
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 920px;
  font-size: clamp(2.1rem, 5.1vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.subcopy {
  max-width: 640px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.panel {
  margin-top: 24px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 16px 32px rgba(34, 58, 97, 0.08);
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.action-group {
  display: flex;
  gap: 10px;
}

.shorten-form {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(180px, 1fr) minmax(160px, 1.1fr) auto;
  gap: 14px;
  align-items: end;
}

.filter-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 18px;
}

.filter-field {
  min-width: 220px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 600;
  min-width: 0;
}

.field-hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 1rem;
  background: white;
}

select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 1rem;
  background: white;
  color: var(--ink);
}

input,
select {
  min-width: 0;
}

input:focus,
select:focus {
  outline: 2px solid rgba(34, 58, 97, 0.18);
  border-color: var(--accent);
}

button {
  height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
}

.submit-button {
  min-width: 132px;
}

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

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost-button:hover {
  background: #eef4fb;
}

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

.danger-button:hover {
  background: var(--danger-dark);
}

.result,
.error {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
}

.result {
  background: var(--success-bg);
  color: var(--success-ink);
}

.error {
  background: var(--error-bg);
  color: var(--error-ink);
}

.result a {
  color: inherit;
  font-weight: 700;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.col-check {
  width: 56px;
}

.col-creator {
  width: 92px;
}

.col-short {
  width: 190px;
}

.col-original {
  width: auto;
}

.col-clicks {
  width: 76px;
}

.col-date {
  width: 138px;
}

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

thead th {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

tbody a {
  color: var(--accent-dark);
  word-break: break-all;
}

.creator-cell,
.numeric-cell {
  white-space: nowrap;
}

.original-url {
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.date-cell {
  white-space: normal;
  word-break: keep-all;
}

.row-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

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

.hidden {
  display: none;
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 24px, 100%);
    padding-top: 32px;
  }

  .panel {
    padding: 22px;
    border-radius: 20px;
  }

  .shorten-form {
    grid-template-columns: 1fr;
  }

  .field-hint {
    font-size: 0.78rem;
  }

  button,
  .ghost-button {
    width: 100%;
  }

  .panel-head {
    flex-direction: column;
  }

  .action-group {
    width: 100%;
    flex-direction: column;
  }

  table {
    table-layout: auto;
  }

  .col-check,
  .col-creator,
  .col-short,
  .col-clicks,
  .col-date {
    width: auto;
  }
}
