:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #fbfbfd;
  --text: #111111;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #000000;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.login-panel {
  width: min(440px, calc(100vw - 32px));
  margin: 12vh auto 0;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: 34px;
}

h2 {
  font-size: 30px;
}

.login-form,
.editor {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input {
  height: 48px;
  padding: 0 15px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 14px 15px;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.login-form button,
.editor button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 18px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.admin {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - 48px);
}

.sidebar,
.workspace {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 22px;
}

.brand > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--accent);
  color: #ffffff;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab,
.ghost-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.tab.active {
  background: var(--accent);
  color: #ffffff;
}

.ghost-button {
  margin-top: auto;
  justify-content: center;
  color: var(--text);
  background: var(--panel-soft);
}

.workspace {
  min-width: 0;
  padding: 26px;
}

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

.domain-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.domain-stack a,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.content-grid,
.broadcast {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.editor,
.list-panel,
.current-broadcast {
  margin: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.editor {
  align-content: start;
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.search {
  position: relative;
  flex: 1;
}

.search span {
  position: absolute;
  left: 13px;
  top: 13px;
  color: var(--muted);
}

.search input {
  padding-left: 44px;
}

.items-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 208px);
  overflow: auto;
  padding-right: 4px;
}

.item-card,
.empty-state {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-soft);
}

.item-card textarea {
  min-height: 104px;
  border-radius: 16px;
  background: #ffffff;
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.item-actions small {
  color: var(--muted);
}

.item-actions div {
  display: flex;
  gap: 8px;
}

.icon-button,
.danger-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
}

.icon-button.save {
  background: var(--accent);
  color: #ffffff;
}

.icon-button.delete,
.danger-button {
  color: var(--danger);
}

.current-broadcast {
  display: grid;
  align-content: start;
  gap: 14px;
}

.current-broadcast .empty-state {
  min-height: 132px;
  color: var(--muted);
  line-height: 1.5;
}

.danger-button {
  width: auto;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  padding: 0 14px;
  font-weight: 700;
}

@media (max-width: 920px) {
  .shell {
    padding: 12px;
  }

  .admin,
  .content-grid,
  .broadcast {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab {
    justify-content: center;
    text-align: center;
  }

  .topbar {
    flex-direction: column;
  }

  .domain-stack {
    justify-content: flex-start;
  }

  .items-list {
    max-height: none;
  }
}

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

  h2 {
    font-size: 25px;
  }

  .workspace,
  .sidebar,
  .login-panel {
    border-radius: 22px;
    padding: 16px;
  }

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