:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #12131a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --green: #16a34a;
  --orange: #f97316;
  --red: #ef4444;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(236, 72, 153, 0.14), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.hero {
  min-height: 150px;
  padding: 22px;
  border-radius: 28px;
  color: white;
  background:
    linear-gradient(135deg, #111827, #1d4ed8 48%, #ec4899);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.76;
  margin-bottom: 8px;
}

.hero h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero p {
  margin: 10px 0 0;
  max-width: 440px;
  opacity: 0.9;
  font-size: 15px;
}

.logo-mark {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 24px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.tabs {
  margin: 16px 0;
  padding: 6px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(229,231,235,0.9);
  border-radius: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tab {
  border: 0;
  padding: 12px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--text);
  color: white;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h2 {
  margin: 14px 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.list {
  display: grid;
  gap: 12px;
}

.card, .form-card, .created-block {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(229,231,235,0.92);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.card {
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.card:active {
  transform: scale(0.99);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.badge.green {
  background: #dcfce7;
  color: #166534;
}

.badge.orange {
  background: #ffedd5;
  color: #9a3412;
}

.badge.red {
  background: #fee2e2;
  color: #991b1b;
}

.badge.gray {
  background: #f3f4f6;
  color: #374151;
}

.form-card {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  font-size: 14px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus, textarea:focus {
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.primary, .ghost {
  border: 0;
  border-radius: 15px;
  padding: 13px 16px;
  font-weight: 900;
  cursor: pointer;
}

.primary {
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: white;
}

.ghost {
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  color: var(--text);
}

.parties {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.party {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.party-name {
  font-weight: 900;
  margin-bottom: 6px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.material {
  min-height: 92px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.links {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.link-item {
  padding: 10px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid var(--line);
  word-break: break-all;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 18px;
  max-width: 520px;
  margin: auto;
  padding: 14px 16px;
  border-radius: 16px;
  background: #111827;
  color: white;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.hidden {
  display: none;
}

@media (max-width: 520px) {
  .hero {
    border-radius: 24px;
    padding: 18px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .logo-mark {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    font-size: 32px;
    border-radius: 19px;
  }
}
