:root {
  --ink: #2c3a4f;
  --muted: #8b97a8;
  --line: #e6ebf1;
  --card: #ffffff;
  --bg: #ffffff;
  --blue: #4c8dff;
  --blue-hover: #3b7ef0;
  --blue-soft: #e8f1ff;
  --ok: #16a34a;
  --err: #dc2626;
  --shadow: 0 10px 40px rgba(28, 45, 70, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 72px 20px 80px;
}

.hero h1 {
  margin: 0 0 18px;
  text-align: center;
  font-size: clamp(36px, 5.4vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: #2b3a4d;
  font-weight: 800;
}
.hero p {
  margin: 0 auto 48px;
  max-width: 740px;
  text-align: center;
  color: #8d99a8;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
  font-weight: 400;
}

.card {
  background: var(--card);
  border: 1px solid #e7edf3;
  border-radius: 16px;
  padding: 28px 28px 26px;
  box-shadow: var(--shadow);
}

label.field-title {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 10px;
  color: #243246;
}
.hint {
  margin: 8px 0 0;
  color: #8a96a6;
  font-size: 13.5px;
  line-height: 1.45;
}

.row-url {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.row-url input {
  flex: 1;
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: 90px; padding-top: 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #b0bac6; }
input:focus, textarea:focus {
  border-color: #93b8ff;
  box-shadow: 0 0 0 4px rgba(76, 141, 255, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--blue-hover); }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 42px; padding: 0 16px; font-size: 14px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.block { margin-top: 18px; }

.advanced {
  display: none;
  margin-top: 16px;
  padding-top: 8px;
}
.advanced.open { display: block; }

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.alert-ok { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.alert-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.result {
  display: none;
  margin-top: 18px;
  padding: 16px;
  background: #f8fbff;
  border: 1px dashed #c9dbff;
  border-radius: 12px;
}
.result.show { display: block; }
.result .short {
  display: flex;
  gap: 10px;
  align-items: center;
}
.result .short input { font-weight: 700; color: #1d4ed8; }
.meta-preview {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.meta-preview img {
  width: 120px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
}
.meta-preview h4 { margin: 0 0 4px; font-size: 14px; }
.meta-preview p { margin: 0; font-size: 12px; color: #64748b; }

.links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.links-table th, .links-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.links-table th { color: #64748b; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.links-table a { color: #2563eb; word-break: break-all; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .wrap { padding-top: 40px; }
  .row-url { flex-direction: column; }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; }
}
