/**
 * Katha Varnika Writer Studio — YouTube Studio inspired UI
 */

/* ─── Admin (wp-admin) ─────────────────────────────────────── */

.kv-ws {
  --kv-ws-accent: #f97316;
  --kv-ws-bg: #f8fafc;
  --kv-ws-card: #ffffff;
  --kv-ws-border: #e5e7eb;
  --kv-ws-ink: #0f172a;
  --kv-ws-muted: #64748b;
  font-family: "Roboto", "Poppins", system-ui, sans-serif;
  color: var(--kv-ws-ink);
}

.kv-ws-admin.wrap { max-width: 1200px; }
.kv-ws__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.kv-ws__header h1 { margin: 0; font-size: 28px; font-weight: 700; }
.kv-ws__eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--kv-ws-accent); }
.kv-ws__layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.kv-ws__nav { display: flex; flex-direction: column; gap: 4px; background: var(--kv-ws-card); border: 1px solid var(--kv-ws-border); border-radius: 12px; padding: 8px; }
.kv-ws__nav-link { display: block; padding: 10px 14px; border-radius: 8px; text-decoration: none; color: var(--kv-ws-ink); font-weight: 500; font-size: 14px; }
.kv-ws__nav-link:hover { background: #fff7ed; color: var(--kv-ws-accent); }
.kv-ws__nav-link.is-active { background: var(--kv-ws-accent); color: #fff; }
.kv-ws__content { background: var(--kv-ws-card); border: 1px solid var(--kv-ws-border); border-radius: 12px; padding: 24px; min-height: 400px; }
.kv-ws__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.kv-ws__card { background: var(--kv-ws-bg); border: 1px solid var(--kv-ws-border); border-radius: 10px; padding: 16px; }
.kv-ws__card-label { margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--kv-ws-muted); }
.kv-ws__card-value { margin: 0; font-size: 24px; font-weight: 700; }
.kv-ws__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kv-ws__toolbar h2 { margin: 0; font-size: 20px; }
.kv-ws__badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e2e8f0; }
.kv-ws__badge--published { background: #dcfce7; color: #166534; }
.kv-ws__badge--draft { background: #f1f5f9; color: #475569; }
.kv-ws__empty, .kv-ws__hint { color: var(--kv-ws-muted); }
.kv-ws__section-sub { margin: 4px 0 0; font-size: 14px; color: var(--kv-ws-muted); font-weight: 400; }
.kv-ws__breadcrumb { margin: 0 0 16px; font-size: 14px; color: var(--kv-ws-muted); }
.kv-ws__breadcrumb a { color: var(--kv-ws-accent); text-decoration: none; }
.kv-ws__breadcrumb a:hover { text-decoration: underline; }

/* Pratilipi-style content guide */
.kv-ws__guide {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #f0f7ff 100%);
}
.kv-ws__guide--compact { padding: 12px 16px; margin-bottom: 16px; }
.kv-ws__guide-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2563eb;
}
.kv-ws__guide-title { margin: 0 0 10px; font-size: 17px; font-weight: 700; color: var(--kv-ws-ink); }
.kv-ws__guide-text, .kv-ws__guide-lead { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: #334155; }
.kv-ws__guide-example, .kv-ws__guide-tip, .kv-ws__guide-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}
.kv-ws__guide-example { font-style: italic; margin-bottom: 8px; }
.kv-ws__guide-tip { color: #2563eb; font-weight: 500; }
.kv-ws__guide-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #dbeafe;
}
.kv-ws__guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.kv-ws__guide-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.kv-ws__guide-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kv-ws__guide-step-body { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; }
.kv-ws__guide-step-body strong { color: var(--kv-ws-ink); font-size: 15px; }
.kv-ws__guide-step-body em { font-size: 13px; color: #64748b; font-style: normal; }
.kv-ws__guide-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.kv-ws__guide-flow-item {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbeafe;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.kv-ws__guide-flow-item--story {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.kv-ws__guide-flow-arrow { color: #94a3b8; font-weight: 700; }

.kv-ws__form label { display: block; font-weight: 600; margin-bottom: 6px; }
.kv-ws__form p { margin-bottom: 16px; }
.kv-ws__cover-preview { margin-top: 10px; }
.kv-ws__cover-preview-img,
.kv-ws__cover-thumb,
.kv-ws__story-cover-img {
  display: block;
  max-width: 240px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--kv-ws-border);
  object-fit: cover;
}
.kv-ws__cover-thumb { max-width: 72px; max-height: 48px; }
.kv-ws__cover-cell { width: 88px; }
.kv-ws__cover-placeholder { color: var(--kv-ws-muted); font-size: 13px; }
.kv-ws__story-cover-panel {
  display: grid;
  grid-template-columns: minmax(120px, 240px) 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--kv-ws-border);
  border-radius: 10px;
  background: var(--kv-ws-bg);
}
.kv-ws__story-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 12px;
  border: 1px dashed var(--kv-ws-border);
  border-radius: 8px;
  color: var(--kv-ws-muted);
  font-size: 13px;
  text-align: center;
}
.kv-ws__status-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
  max-width: 160px;
  white-space: normal;
}

.kv-ws__status-box {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.kv-ws__status-box--draft {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.kv-ws__status-box--published {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.kv-ws__status-box-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.kv-ws__status-box-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.kv-ws__status-box-text {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

.kv-ws__status-box-action {
  margin: 0;
}

.kv-ws__autosave-status {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.kv-ws__autosave-status.is-saving {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.kv-ws__autosave-status.is-saved {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.kv-ws__autosave-status.is-error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.kv-ws__premium-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.kv-ws__form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.kv-ws__cover-preview--current {
  margin-bottom: 10px;
}
.kv-ws__field--editor { margin-bottom: 20px; }
.kv-ws__field-label { display: block; font-weight: 600; margin-bottom: 8px; }
.kv-ws__editor-wrap .wp-editor-wrap {
  border: 1px solid var(--kv-ws-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.kv-ws__editor-wrap .wp-editor-tools { background: #fff; border-bottom: 1px solid var(--kv-ws-border); }
.kv-ws__editor-wrap .wp-editor-container { border-top: 0; }
.kv-ws__editor-wrap .mce-toolbar-grp { border-bottom: 1px solid var(--kv-ws-border) !important; }
.kv-ws__editor-wrap .quicktags-toolbar { border-bottom: 1px solid var(--kv-ws-border); }
.kv-ws__editor-wrap .wp-editor-area {
  min-height: 180px;
  font-family: inherit;
}
.kv-ws__notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.kv-ws__notice--ok { background: #dcfce7; color: #166534; }
.kv-ws__notice--err { background: #fee2e2; color: #991b1b; }
.kv-ws__notif-list { list-style: none; margin: 0; padding: 0; }
.kv-ws__notif-list li { padding: 12px 0; border-bottom: 1px solid var(--kv-ws-border); display: flex; justify-content: space-between; gap: 12px; }

/* ═══════════════════════════════════════════════════════════
   YouTube Studio — Frontend
   ═══════════════════════════════════════════════════════════ */

.kv-writer-studio-page .kv-ws-front {
  padding: 0 !important;
  margin: 0 !important;
  background: #f9f9f9 !important;
  max-width: 100% !important;
  min-height: 100vh !important;
}

.kv-yt-studio-app {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}

.kv-ws-studio-gate-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 24px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kv-ws-studio-wrap {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.kv-yt-studio,
.kv-ws-studio.kv-yt-studio {
  display: grid !important;
  grid-template-columns: 240px minmax(0, 1fr) !important;
  min-height: 100vh;
  background: #f9f9f9;
  font-family: "Roboto", "Poppins", Arial, sans-serif;
  color: #0f0f0f;
  width: 100%;
}

.kv-yt-studio__sidebar,
.kv-ws-studio__sidebar.kv-yt-studio__sidebar {
  background: #fff !important;
  border-right: 1px solid #e5e5e5 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 12px 0 !important;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  width: 240px;
  min-width: 240px;
}

.kv-yt-studio__logo {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 16px;
  text-decoration: none !important;
  color: #0f0f0f !important;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 8px;
}

.kv-yt-studio__logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f97316;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kv-yt-studio__logo-text {
  font-size: 16px;
  font-weight: 600;
}

.kv-yt-studio__channel {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 4px 8px 8px;
  border-radius: 10px;
  text-decoration: none !important;
  color: inherit;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.kv-yt-studio__channel:hover,
.kv-yt-studio__channel:focus-visible {
  background: #fff7ed;
  border-color: #fed7aa;
  outline: none;
}

.kv-yt-studio__avatar {
  border-radius: 50% !important;
  width: 40px !important;
  height: 40px !important;
  flex-shrink: 0;
}

.kv-yt-studio__channel-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.kv-yt-studio__channel-meta strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f0f0f;
  line-height: 1.3;
}

.kv-yt-studio__channel-meta span {
  display: block;
  font-size: 12px;
  color: #606060;
}

.kv-yt-studio__channel-go {
  flex-shrink: 0;
  color: #fb923c;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.9;
}

.kv-yt-studio__channel:hover .kv-yt-studio__channel-go {
  color: #ea580c;
  opacity: 1;
}

.kv-ws__public-link-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  max-width: 40rem;
}

.kv-ws__public-link-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.kv-ws__public-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  text-decoration: none !important;
  color: #c2410c !important;
  font-weight: 600;
  word-break: break-all;
}

.kv-ws__public-link:hover .kv-ws__public-link-url {
  text-decoration: underline;
}

.kv-ws__public-link-open {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.kv-ws__public-link:hover .kv-ws__public-link-open {
  background: #ffedd5;
}

.kv-ws__public-link-meta {
  font-size: 0.9rem;
  color: #64748b;
}

.kv-yt-studio__nav,
.kv-ws-studio__nav.kv-yt-studio__nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  padding: 0 8px !important;
  flex: 1;
}

.kv-yt-studio__nav-link,
.kv-ws-studio__nav-link.kv-yt-studio__nav-link {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 20px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  color: #0f0f0f !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  transition: background 0.1s;
}

.kv-yt-studio__nav-link:hover,
.kv-ws-studio__nav-link.kv-yt-studio__nav-link:hover {
  background: #f2f2f2 !important;
  color: #0f0f0f !important;
}

.kv-yt-studio__nav-link.is-active,
.kv-ws-studio__nav-link.kv-yt-studio__nav-link.is-active {
  background: #fff1e6 !important;
  color: #c2410c !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.kv-yt-studio__nav-link.is-active .kv-ws-studio__nav-icon,
.kv-ws-studio__nav-link.is-active .kv-ws-studio__nav-icon {
  color: #f97316;
}

.kv-ws-studio__nav-icon {
  display: flex !important;
  width: 24px;
  flex-shrink: 0;
  justify-content: center;
}

.kv-yt-studio__nav-label {
  white-space: nowrap;
}

.kv-yt-studio__sidebar-foot,
.kv-ws-studio__sidebar-foot.kv-yt-studio__sidebar-foot {
  padding: 12px 20px 8px !important;
  border-top: 1px solid #f0f0f0 !important;
  margin-top: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.kv-yt-studio__sidebar-foot .kv-yt-studio__nav-link {
  font-size: 13px !important;
  color: #606060 !important;
  padding: 6px 0 !important;
  gap: 8px !important;
}

/* ── Main content area ── */

.kv-yt-studio__main,
.kv-ws-studio__main.kv-yt-studio__main {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0;
  background: #f9f9f9;
}

.kv-yt-studio__topbar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 10;
}

.kv-yt-studio__page-title {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  color: #0f0f0f !important;
}

.kv-yt-studio__btn--create {
  display: inline-flex !important;
  align-items: center;
  padding: 0 16px;
  height: 36px;
  background: #fff !important;
  border: 1px solid #d3d3d3 !important;
  border-radius: 18px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #606060 !important;
  text-decoration: none !important;
  letter-spacing: 0.02em;
}

.kv-yt-studio__btn--create:hover {
  background: #f2f2f2 !important;
  color: #0f0f0f !important;
}

.kv-yt-studio__body,
.kv-ws-studio__body.kv-yt-studio__body {
  padding: 24px !important;
  flex: 1;
}

.kv-yt-studio__panel,
.kv-ws-studio__panel {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  min-height: auto !important;
}

/* ── Dashboard cards (YouTube style) ── */

.kv-yt-studio__welcome {
  margin: 0 0 20px;
  font-size: 14px;
  color: #606060;
}

.kv-yt-studio__card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.kv-yt-studio__card-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  color: #0f0f0f;
}

.kv-yt-studio__card-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: #606060;
}

.kv-yt-studio__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kv-yt-studio__card-head .kv-yt-studio__card-title {
  margin: 0;
}

.kv-yt-studio__metrics {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px;
}

.kv-yt-studio__metric {
  padding: 12px 0;
}

.kv-yt-studio__metric-label {
  display: block;
  font-size: 12px;
  color: #606060;
  margin-bottom: 6px;
}

.kv-yt-studio__metric-value {
  display: block;
  font-size: 28px;
  font-weight: 400;
  color: #0f0f0f;
  line-height: 1;
}

.kv-yt-studio__metric-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #909090;
}

.kv-yt-studio__latest {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.kv-yt-studio__latest-thumb {
  width: 120px;
  height: 68px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e1b4b, #f97316);
  flex-shrink: 0;
}

.kv-yt-studio__latest-body h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
}

.kv-yt-studio__latest-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #606060;
  margin-bottom: 8px;
}

.kv-yt-studio__link {
  color: #065fd4 !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
}

.kv-yt-studio__link:hover {
  text-decoration: underline !important;
}

.kv-yt-studio__grid-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px;
  margin-bottom: 16px;
}

.kv-yt-studio__big-num {
  margin: 8px 0;
  font-size: 36px;
  font-weight: 400;
  color: #0f0f0f;
}

.kv-yt-studio__actions {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px;
}

.kv-yt-studio__action {
  display: block;
  padding: 16px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  text-decoration: none !important;
  color: #0f0f0f !important;
  transition: background 0.1s, border-color 0.1s;
}

.kv-yt-studio__action:hover {
  background: #f9f9f9;
  border-color: #ccc;
}

.kv-yt-studio__action strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.kv-yt-studio__action span {
  font-size: 12px;
  color: #606060;
}

/* ── Buttons & forms ── */

.kv-yt-studio__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.kv-yt-studio__btn--primary {
  background: #065fd4;
  color: #fff !important;
}

.kv-yt-studio__btn--primary:hover {
  background: #0550b3;
}

.kv-ws-front .widefat,
.kv-yt-studio__panel .widefat {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.kv-ws-front .widefat th,
.kv-ws-front .widefat td,
.kv-yt-studio__panel .widefat th,
.kv-yt-studio__panel .widefat td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
}

.kv-ws-front .widefat thead th,
.kv-yt-studio__panel .widefat thead th {
  background: #fafafa;
  font-size: 12px;
  font-weight: 500;
  color: #606060;
}

.kv-ws-front .widefat tbody tr:hover td {
  background: #fafafa;
}

.kv-ws-front .regular-text,
.kv-ws-front .large-text,
.kv-ws-front select,
.kv-yt-studio__panel .regular-text,
.kv-yt-studio__panel .large-text,
.kv-yt-studio__panel select {
  width: 100%;
  max-width: 640px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: inherit;
  background: #fff;
}

.kv-ws-front .kv-ws__form--inline,
.kv-yt-studio__panel .kv-ws__form--inline {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.kv-ws__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.kv-ws__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none !important;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.kv-ws__btn--edit {
  background: #eff6ff;
  color: #1d4ed8 !important;
  border-color: #bfdbfe;
}

.kv-ws__btn--edit:hover {
  background: #dbeafe;
  color: #1e40af !important;
}

.kv-ws__btn--parts {
  background: #ecfdf5;
  color: #047857 !important;
  border-color: #a7f3d0;
}

.kv-ws__btn--parts:hover {
  background: #d1fae5;
  color: #065f46 !important;
}

.kv-ws__btn--view {
  background: #f8fafc;
  color: #475569 !important;
  border-color: #e2e8f0;
}

.kv-ws__btn--view:hover {
  background: #e2e8f0;
  color: #334155 !important;
}

.kv-ws__avatar-field {
  margin: 0 0 1.25rem;
}

.kv-ws__avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.kv-ws__avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.kv-ws__avatar-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 220px;
  flex: 1 1 220px;
}

.kv-ws__avatar-controls label {
  font-weight: 600;
}

.kv-ws__check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  margin-top: 0.35rem;
}

.kv-ws__btn--delete {
  background: #fef2f2;
  color: #b91c1c !important;
  border-color: #fecaca;
  cursor: pointer;
  font-family: inherit;
}

.kv-ws__btn--order {
  background: #f1f5f9;
  color: #334155 !important;
  border-color: #cbd5e1;
  min-width: 2rem;
  cursor: pointer;
  font-family: inherit;
}

.kv-ws__btn--order:hover:not(:disabled) {
  background: #e2e8f0;
}

.kv-ws__btn--order:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.kv-ws__nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.kv-yt-studio__nav-link .kv-ws__nav-badge {
  margin-left: auto;
}

.kv-ws__notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.kv-ws__notif-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.kv-ws__notif-item.is-unread {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.kv-ws__notif-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.kv-ws__notif-time {
  font-size: 0.85rem;
  color: #64748b;
}

.kv-ws__schedule-field input[type="datetime-local"] {
  display: block;
  margin-top: 0.35rem;
}

/* Public writer profile */
.kv-writer-public {
  padding: 2rem 1rem 3rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 40%);
}

.kv-writer-public__inner {
  max-width: 720px;
  margin: 0 auto;
}

.kv-writer-public__hero {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.kv-writer-public__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.kv-writer-public__name {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  line-height: 1.2;
}

.kv-writer-public__bio {
  margin: 0 0 0.75rem;
  color: #475569;
  line-height: 1.5;
}

.kv-writer-public__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  color: #64748b;
  font-size: 0.95rem;
}

.kv-writer-public__btn {
  display: inline-flex;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.kv-writer-public__btn--ghost {
  background: #fff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.kv-writer-public__notice {
  margin: 0.5rem 0 0;
  color: #047857;
  font-size: 0.9rem;
}

.kv-writer-public__notice--err {
  color: #b91c1c;
}

.kv-writer-public__story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kv-writer-public__story-list a {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.kv-writer-public__story-list img {
  width: 56px;
  height: 74px;
  object-fit: cover;
  border-radius: 6px;
  background: #f1f5f9;
}

.kv-writer-public__story-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kv-writer-public__story-body span {
  color: #64748b;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .kv-writer-public__hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.kv-ws__btn--delete:hover {
  background: #fee2e2;
  color: #991b1b !important;
}

.kv-ws__inline-form {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}

.kv-ws__danger-zone {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #fecaca;
}

.kv-ws__comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kv-ws__comment {
  padding: 1rem 1.125rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.kv-ws__comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.kv-ws__comment-on,
.kv-ws__comment-meta time {
  color: #64748b;
  font-size: 0.85rem;
}

.kv-ws__comment-body {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.kv-ws__comment-replies {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 3px solid #e2e8f0;
}

.kv-ws__comment-reply {
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.kv-ws__comment-reply--mine {
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.kv-ws__reply-form textarea {
  width: 100%;
  max-width: 40rem;
  margin-bottom: 0.5rem;
}

.kv-ws-front .kv-ws__actions a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.kv-ws-front__gate {
  text-align: center;
  padding: 64px 24px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .kv-yt-studio,
  .kv-ws-studio.kv-yt-studio {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }

  .kv-yt-studio__sidebar {
    width: 72px;
    min-width: 72px;
  }

  .kv-yt-studio__logo-text,
  .kv-yt-studio__channel-meta,
  .kv-yt-studio__nav-label,
  .kv-yt-studio__sidebar-foot {
    display: none !important;
  }

  .kv-yt-studio__logo {
    justify-content: center;
    padding: 8px;
  }

  .kv-yt-studio__channel {
    justify-content: center;
    padding: 8px;
  }

  .kv-yt-studio__nav-link {
    justify-content: center !important;
    padding: 12px !important;
  }

  .kv-yt-studio__metrics {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .kv-yt-studio__grid-2,
  .kv-yt-studio__actions {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .kv-yt-studio,
  .kv-ws-studio.kv-yt-studio {
    grid-template-columns: 1fr !important;
  }

  .kv-yt-studio__sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid #e5e5e5;
  }

  .kv-yt-studio__nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    width: 100%;
  }

  .kv-yt-studio__metrics {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 782px) {
  .kv-ws__layout { grid-template-columns: 1fr; }
}
