.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tool-btn {
  min-width: 34px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.text-toolbar-hint {
  margin: -2px 0 8px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
}

.field-checkbox span {
  margin-bottom: 0;
}

.field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--button);
}

.field-checkbox-glass {
  margin-top: 2px;
}

.glass-toggle-title {
  margin-bottom: 8px;
}

.glass-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.glass-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.glass-toggle input[type="checkbox"]:focus,
.glass-toggle input[type="checkbox"]:focus-visible {
  outline: none;
}

.glass-toggle-side {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15px;
  color: var(--muted);
  transition: color 0.18s ease, transform 0.18s ease;
}

.glass-switch-track {
  position: relative;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(39, 51, 73, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -8px 18px rgba(0, 0, 0, 0.24),
    0 8px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(calc(var(--blur) / 2));
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.glass-switch-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(222, 231, 242, 0.88));
  box-shadow:
    0 4px 10px rgba(13, 22, 38, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: transform 0.2s cubic-bezier(0.25, 0.9, 0.28, 1), background 0.2s ease;
}

.glass-toggle input[type="checkbox"]:checked ~ .glass-switch-track {
  background:
    linear-gradient(140deg, rgba(150, 233, 199, 0.35), rgba(95, 174, 255, 0.24)),
    rgba(32, 78, 101, 0.5);
  border-color: rgba(147, 222, 201, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(196, 242, 228, 0.45),
    inset 0 -10px 20px rgba(14, 54, 69, 0.3),
    0 10px 18px rgba(16, 51, 70, 0.25);
}

.glass-toggle input[type="checkbox"]:checked ~ .glass-switch-track .glass-switch-thumb {
  transform: translateX(26px);
  background: linear-gradient(145deg, rgba(233, 255, 245, 0.98), rgba(189, 243, 220, 0.9));
}

.glass-toggle input[type="checkbox"]:checked ~ .glass-toggle-yes {
  color: var(--ink);
  transform: translateX(1px);
}

.glass-toggle input[type="checkbox"]:not(:checked) ~ .glass-toggle-no {
  color: var(--ink);
  transform: translateX(-1px);
}

:root[data-theme="light"] .glass-switch-track {
  border-color: rgba(15, 20, 26, 0.16);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.72), rgba(242, 247, 255, 0.58)),
    rgba(190, 205, 224, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -7px 16px rgba(33, 56, 88, 0.11),
    0 8px 15px rgba(22, 42, 74, 0.14);
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  backdrop-filter: blur(calc(var(--blur) / 2));
}

textarea::placeholder,
input[type="text"]::placeholder {
  color: rgba(245, 247, 250, 0.72);
}

:root[data-theme="light"] textarea::placeholder,
:root[data-theme="light"] input[type="text"]::placeholder {
  color: rgba(15, 20, 26, 0.62);
}

textarea {
  resize: none;
  overflow: hidden;
  min-height: 120px;
}

input[type="file"] {
  display: none;
}

textarea:focus,
input[type="text"]:focus {
  outline: 2px solid rgba(79, 156, 228, 0.28);
  border-color: rgba(79, 156, 228, 0.55);
}

.field-invalid {
  border-color: rgba(212, 60, 60, 0.7);
  outline: 2px solid rgba(212, 60, 60, 0.25);
}

.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--chip-bg);
  color: var(--chip-ink);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
}

.chips {
  display: flex;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
}

.photo-actions {
  display: flex;
  gap: 8px;
  margin: 8px 0 10px;
}

.photo-item {
  position: relative;
}

.photo-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
}

.photo-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  z-index: 2;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.form-actions .ghost {
  flex: 1;
}

.form-actions .ghost:first-child {
  flex: 1;
}

.form-actions .ghost:last-child {
  flex: 1;
}

.publish-wide {
  width: 100%;
  margin-top: 10px;
}
