/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *

 */

:root {
  --ifcas-primary: #E9491D;
  --ifcas-primary-dark: #c83d17;
  --ifcas-primary-soft: #fff1ec;
  --ifcas-primary-border: #f6b9a7;
  --ifcas-primary-ring: rgba(233, 73, 29, 0.18);
  --compose-selected-border: #10b981;
  --compose-selected-bg: #f0fdf4;
  --compose-selected-text: #047857;
  --compose-selected-ring: rgba(16, 185, 129, 0.18);
  --compose-pending-border: #cbd5e1;
  --compose-pending-bg: #f8fafc;
  --compose-candidate-surface: #fafafa;
  --compose-candidate-border: #e5e7eb;
  --compose-candidate-item-border: #d1d5db;
  --ifcas-card-border: #e5e7eb;
  --ifcas-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --ifcas-card-hover-shadow: 0 8px 20px rgba(17, 24, 39, 0.09);
  --fab-size-mobile: 3.65rem;
  --fab-size-desktop: 3.5rem;
  --fab-border-width: 4px;
  --fab-border-color: #d1d5db;
  --fab-border-color-hover: #c4c4c4;
  --fab-badge-size: 0.8125rem;
  --fab-panel-shadow: 0 8px 22px rgba(17, 24, 39, 0.13);
  --character-male-bg: #F8FBFF;
  --character-female-bg: #FFF9FB;
  --character-other-bg: #FFFDF5;
  --character-unknown-bg: #FFFFFF;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f0f2f5;
  color: #1a1a1a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: 1.75rem;
}

h2.section-title {
  font-size: 1.125rem;
  color: #444;
  margin: 2rem 0 1rem;
}

.page-header {
  margin: 0 0 1.5rem;
}

.page-title {
  margin: 0 0 0.375rem;
  font-size: 1.75rem;
  line-height: 1.3;
}

.page-lead {
  margin: 0;
  color: #666;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.page-lead a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.page-lead a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.page-lead-separator {
  color: #999;
}

.page-meta {
  margin: 0.375rem 0 0;
  color: #666;
  font-size: 0.875rem;
  line-height: 1.5;
}

.page-back-link {
  margin: 0.75rem 0 0;
}

.page-back-link a,
.page-back-link__anchor {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #555;
  font-size: 0.875rem;
  text-decoration: none;
}

.page-back-link a:hover,
.page-back-link__anchor:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.page-back-link__icon {
  font-size: 0.8em;
}

.back-link {
  margin: 0.75rem 0 0;
}

.back-link a {
  color: #555;
  font-size: 0.9rem;
  text-decoration: none;
}

.back-link a:hover {
  color: var(--ifcas-primary);
  text-decoration: underline;
}

.description {
  color: #444;
  line-height: 1.7;
  margin: 0 0 1.5rem;
  white-space: pre-wrap;
}

.profile-edit-link {
  margin: -0.75rem 0 1.5rem;
  font-size: 0.875rem;
}

.profile-edit-link a {
  color: #555;
  text-decoration: none;
}

.profile-edit-link a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.work-information {
  margin-bottom: 1.5rem;
}

.work-metadata {
  margin: 0;
}

.work-metadata > div {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.work-metadata dt {
  color: #666;
  font-size: 0.875rem;
  font-weight: 700;
}

.work-metadata dd {
  margin: 0;
}

.work-synopsis {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.work-synopsis h2 {
  color: #444;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.work-synopsis p {
  color: #444;
  line-height: 1.8;
  margin: 0;
  overflow-wrap: anywhere;
}

.work-synopsis p + p {
  margin-top: 0.75rem;
}

.work-profile-card {
  --work-profile-official-links-inset: 1.125rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.75rem;
  padding: 1.625rem 1.375rem 1.5rem;
  text-align: center;
  border: 2px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.work-profile-category {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
}

.work-profile-category a {
  color: #777;
  text-decoration: none;
}

.work-profile-category a:hover {
  color: var(--ifcas-primary);
  text-decoration: none;
}

.work-profile-category.profile-card-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3125rem;
}

.profile-card-type i {
  color: var(--ifcas-primary);
  font-size: 0.8125rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.9;
}

.entity-profile-header {
  margin: 0;
  text-align: center;
}

.entity-profile-header__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
}

.entity-profile-header__eyebrow a {
  color: #777;
  text-decoration: none;
}

.entity-profile-header__eyebrow a:hover {
  color: var(--ifcas-primary);
  text-decoration: none;
}

.entity-profile-header__title,
.work-profile-card .entity-profile-header__title {
  margin: 0.125rem 0 1.25rem;
  color: #111;
  font-size: clamp(1.2rem, 6.5vw, 2.125rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.08;
}

.entity-profile-header__title--with-kana,
.work-profile-title--with-kana {
  margin-bottom: 0.25rem;
}

.entity-profile-header__kana,
.work-profile-kana {
  margin: 0 0 1.125rem;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}

.work-profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0;
  width: 100%;
  margin: -0.375rem 0 1.125rem;
}

.work-profile-meta-item {
  color: #666;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
}

.work-profile-meta-sep {
  margin: 0 0.4375rem;
  color: #d1d5db;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1;
}

.work-profile-synopsis {
  width: 100%;
  margin: 0 0 1.25rem;
  padding: clamp(0.7rem, 2.4vw, 0.85rem) clamp(0.9rem, 3vw, 1.1rem);
  border: 2px solid #e8ebef;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #111;
  font-size: clamp(0.95rem, 3.4vw, 1.0625rem);
  line-height: 1.68;
  text-align: left;
}

.work-profile-synopsis p {
  margin: 0;
}

.work-profile-synopsis p + p {
  margin-top: 0.875rem;
}

.work-profile-synopsis--empty {
  padding: clamp(0.75rem, 2.5vw, 0.875rem) clamp(1rem, 3.5vw, 1.125rem);
  border-style: dashed;
  color: #888;
  font-size: 0.875rem;
  line-height: 1.65;
  text-align: center;
}

.work-profile-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.125rem;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto 1.25rem;
  padding: 1rem 0 0;
  border-top: none;
}

.work-profile-synopsis + .work-profile-stats,
.work-profile-synopsis--empty + .work-profile-stats {
  border-top: 1px solid #e5e7eb;
}

.work-profile-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3125rem;
  margin: 0;
  color: #888;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.profile-stat-icon {
  color: var(--ifcas-primary);
  font-size: 0.75rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.85;
}

.work-profile-stat__value {
  color: #444;
  font-size: 0.8125rem;
  font-weight: 700;
}

.work-profile-post-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 20rem);
  min-height: 3.25rem;
  padding: 0.875rem 1.25rem;
  border: 2px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.work-profile-post-button:hover {
  background: var(--ifcas-primary);
  border-color: var(--ifcas-primary);
}

.work-profile-card .official-links-section {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

.official-links-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  margin: 0 0 0.625rem;
  color: #666;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.official-links-section-icon {
  color: var(--ifcas-primary);
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.9;
}

.official-links-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem 2rem;
  width: min(
    100%,
    calc(100% - (2 * var(--work-profile-official-links-inset, 1.125rem)))
  );
  margin: 0 auto;
  padding: 0 0 1rem;
  border-bottom: 1px solid #e5e7eb;
  list-style: none;
}

.official-links-item {
  margin: 0;
  flex: 0 1 auto;
  max-width: 100%;
}

.official-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: #444;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.official-link:hover {
  color: var(--ifcas-primary);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ifcas-primary) 45%, transparent);
  text-underline-offset: 0.18em;
}

.official-link__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-link__icon {
  flex-shrink: 0;
  width: 0.9375rem;
  margin-right: 0.375rem;
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.82;
  text-align: center;
}

.official-link__external-icon {
  flex-shrink: 0;
  margin-left: 0.3125rem;
  font-size: 0.6875rem;
  line-height: 1;
  opacity: 0.55;
}

.work-supporting-characters {
  margin-bottom: 1.75rem;
}

.work-character-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-character-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  border: 1px solid #ddd;
  border-radius: 14px;
  background: #fff;
  color: #333;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.work-character-tag:hover {
  border-color: var(--ifcas-primary-border);
  background: #fff;
  color: var(--ifcas-primary);
  box-shadow: var(--ifcas-card-hover-shadow);
  transform: translateY(-2px);
}

a {
  color: var(--ifcas-primary-dark);
}

.card {
  background: #fff;
  border: 1px solid var(--ifcas-card-border);
  border-radius: 16px;
  box-shadow: var(--ifcas-card-shadow);
  padding: 1.25rem;
}

.work-profile-card.card {
  border: 2px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  padding: 1.625rem 1.375rem 1.5rem;
}

.ui-card {
  background: #fff;
  border: 1px solid var(--ifcas-card-border);
  border-radius: 16px;
  box-shadow: var(--ifcas-card-shadow);
}

.ui-card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ui-card-link:hover {
  border-color: var(--ifcas-primary-border);
  background: #fff;
  box-shadow: var(--ifcas-card-hover-shadow);
  transform: translateY(-2px);
}

.ui-card-title {
  color: #111;
  transition: color 0.16s ease;
}

.ui-card-link:hover .ui-card-title {
  color: var(--ifcas-primary);
}

.character-card.gender-male,
.timeline-card.gender-male,
.casting-detail-card.gender-male {
  background: var(--character-male-bg);
}

.character-card.gender-female,
.timeline-card.gender-female,
.casting-detail-card.gender-female {
  background: var(--character-female-bg);
}

.character-card.gender-other,
.timeline-card.gender-other,
.casting-detail-card.gender-other {
  background: var(--character-other-bg);
}

.character-card.gender-unknown,
.timeline-card.gender-unknown,
.casting-detail-card.gender-unknown {
  background: var(--character-unknown-bg);
}

.character-card.gender-male:hover,
.timeline-card.gender-male:hover,
.casting-detail-card.gender-male:hover {
  background: var(--character-male-bg);
}

.character-card.gender-female:hover,
.timeline-card.gender-female:hover,
.casting-detail-card.gender-female:hover {
  background: var(--character-female-bg);
}

.character-card.gender-other:hover,
.timeline-card.gender-other:hover,
.casting-detail-card.gender-other:hover {
  background: var(--character-other-bg);
}

.character-card.gender-unknown:hover,
.timeline-card.gender-unknown:hover,
.casting-detail-card.gender-unknown:hover {
  background: var(--character-unknown-bg);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li + li {
  border-top: 1px solid #f0f0f0;
}

.link-list a {
  display: block;
  padding: 0.875rem 0.25rem;
  text-decoration: none;
  font-weight: 500;
}

.link-list a:hover {
  background: #f9fafb;
  border-radius: 6px;
}

.notice {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
}

.empty-message {
  color: #666;
  margin: 0;
}

.page-lead {
  color: #555;
  line-height: 1.7;
  margin: 0.5rem 0 0;
}

.static-page {
  max-width: 42rem;
  margin: 0 auto;
  color: #374151;
  font-size: clamp(0.9375rem, 3.2vw, 1rem);
  line-height: 1.85;
}

.static-page-card {
  margin-bottom: 2rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  border: 2px solid var(--ifcas-card-border);
  border-radius: 24px;
  box-shadow: var(--ifcas-card-shadow);
}

.static-page p {
  margin: 0;
}

.static-page p + p {
  margin-top: 1rem;
}

.static-page h2 {
  margin: 2rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f3f4f6;
  color: #111;
  font-size: clamp(1.05rem, 3.5vw, 1.125rem);
  font-weight: 800;
  line-height: 1.45;
  scroll-margin-top: 5rem;
}

.static-page-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.static-page-list li + li {
  margin-top: 0.35rem;
}

.static-page-toc {
  margin: 1.5rem 0 0;
  padding: 1rem 1.125rem;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  background: #f9fafb;
}

.static-page-toc-title {
  margin: 0 0 0.65rem;
  color: #111;
  font-size: 0.875rem;
  font-weight: 800;
}

.static-page-toc-list {
  margin: 0;
  padding-left: 1.125rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.static-page-toc-list li + li {
  margin-top: 0.35rem;
}

.static-page-toc-link {
  color: #374151;
  font-weight: 600;
  text-decoration: none;
}

.static-page-toc-link:hover,
.static-page-toc-link:focus {
  color: var(--ifcas-primary);
  text-decoration: underline;
}

.static-document-meta {
  margin: 2rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ifcas-primary-border);
  border-radius: 14px;
  background: var(--ifcas-primary-soft);
  color: #374151;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.static-contact-block {
  margin-bottom: 1rem;
}

.static-contact-placeholder-note {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.static-contact-actions {
  margin-top: 1.25rem;
}

.static-contact-mail-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: min(100%, 24rem);
  margin: 0 auto;
  padding: 0.95rem 1.25rem;
  border: 2px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.static-contact-mail-button:hover,
.static-contact-mail-button:focus {
  background: var(--ifcas-primary);
  border-color: var(--ifcas-primary);
  color: #fff;
  outline: none;
}

.static-contact-mail-icon {
  font-size: 1.125rem;
}

.static-contact-mail-label {
  font-size: 0.9375rem;
}

.static-contact-mail-address {
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.92;
  word-break: break-all;
}

.site-footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  color: #666;
  font-size: 0.875rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.footer-nav a {
  color: #555;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ifcas-primary);
  text-decoration: underline;
}

.footer-copy {
  margin: 0;
}

.footer-beta-note {
  margin: 0 0 0.5rem;
  color: #888;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.character-section {
  margin-bottom: 1rem;
}

.character-section h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.character-section h3 a {
  text-decoration: none;
}

.character-section h3 a:hover {
  text-decoration: underline;
}

.character-ranking {
  margin-bottom: 1.75rem;
}

.character-ranking-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.character-ranking-link {
  color: inherit;
  text-decoration: none;
}

.character-ranking-link:hover {
  text-decoration: underline;
}

.character-actor-ranking-list {
  margin-top: 0.75rem;
}

.character-actor-ranking-card .ranking-card-layout {
  display: block;
  padding: 1.125rem;
}

.character-actor-ranking-title,
.character-actor-ranking-type,
.character-actor-ranking-total {
  display: block;
  width: 100%;
  margin: 0;
}

.character-actor-ranking-title {
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
}

.character-actor-ranking-type {
  color: #6b7280;
}

.character-actor-ranking-total {
  color: #374151;
  font-size: 1rem;
  font-weight: 800;
}

.actor-ranking-list {
  margin: 0;
  padding-left: 2rem;
}

.actor-ranking-list li {
  padding: 0.625rem 0.25rem;
  border-bottom: 1px solid #f0f0f0;
}

.actor-ranking-list li:last-child {
  border-bottom: 0;
}

.ranked-actor-name {
  font-weight: 600;
}

.ranked-actor-name a,
.actor-name .actor-link {
  color: inherit;
  text-decoration: none;
}

.ranked-actor-name a:hover,
.actor-name .actor-link:hover {
  text-decoration: underline;
}

.casting-count {
  margin-left: 0.375rem;
  color: #666;
  font-size: 0.875rem;
}

.ranking-section {
  margin-bottom: 1rem;
}

.ranking-tabs {
  margin-bottom: 1rem;
}

.ranking-section .section-title {
  margin-top: 0;
}

.ranking-section--compact {
  margin-bottom: 1.75rem;
}

.ranking-section--compact .ranking-card-layout {
  padding: 1.125rem;
  min-height: auto;
  gap: 0.875rem;
}

.ranking-section--compact .ranking-rank {
  min-width: 3.25rem;
}

.ranking-section--compact .ranking-card-title {
  margin-bottom: 0.375rem;
  font-size: 1.5rem;
}

.ranking-card-layout--stacked {
  display: block;
  padding: 1.125rem;
  min-height: auto;
}

.ranking-card-layout--stacked .ranking-card-title--with-rank {
  margin-bottom: 0.5rem;
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
}

.ranking-index-section .section-title {
  margin: 0 0 1rem;
  font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  line-height: 1.45;
  color: #111;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ranking-card-line--total {
  font-weight: 800;
}

.ranking-card-line-secondary {
  color: #6b7280;
  font-weight: 600;
}

.ranking-index-card .ranking-card-title--with-rank,
.character-actor-ranking-title {
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
}

.ranking-card-title--with-rank {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}

.ranking-rank--inline {
  flex: 0 0 auto;
  min-width: 0;
  line-height: 1.35;
}

.ranking-card-title-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ranking-card-line {
  display: block;
  margin: 0 0 0.25rem;
  color: #6b7280;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
}

.ranking-card-line:last-child {
  margin-bottom: 0;
}

.ranking-card-line--total {
  color: #374151;
}

.ranking-card-line-label {
  font-weight: 600;
}

.ranking-section--compact .ranking-card-stat--secondary {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.ranking-section--compact .ranking-card-stat--secondary:last-of-type {
  margin-bottom: 0;
}

.ranking-section--compact .ranking-card-stat--primary {
  font-size: 1.05rem;
}

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

.ranking-card {
  margin: 0;
}

.ranking-card-link,
.ranking-card-shell {
  display: block;
  border: 2px solid #d0d0d0;
  border-radius: 24px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ranking-card-link:hover,
.ranking-card-shell:hover {
  background: #fff;
  border-color: var(--ifcas-primary-border);
  box-shadow: var(--ifcas-card-hover-shadow);
  transform: translateY(-2px);
}

.ranking-card-link {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.125rem;
  min-height: 4.25rem;
}

.ranking-card-shell {
  position: relative;
}

.ranking-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 24px;
}

.ranking-card-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.125rem;
  min-height: 4.25rem;
}

.ranking-card-layout.ranking-card-layout--stacked {
  display: block;
  padding: 1.125rem;
  min-height: auto;
}

.ranking-rank {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 3.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.ranking-rank--gold {
  border-color: #f1c453;
  background: #fff7d6;
  color: #9a6700;
}

.ranking-rank--silver {
  border-color: #cfd6df;
  background: #f4f6f8;
  color: #58606b;
}

.ranking-rank--bronze {
  border-color: #d9a36f;
  background: #fff0df;
  color: #8a4b17;
}

.ranking-rank--gold,
.ranking-rank--silver,
.ranking-rank--bronze {
  min-width: 4rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.7rem;
  font-size: 1.08rem;
}

.ranking-rank-icon {
  font-size: 0.95em;
  line-height: 1;
}

.ranking-rank-number {
  line-height: 1;
}

.ranking-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.ranking-card-title {
  margin: 0 0 0.5rem;
  color: #111;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.25;
  transition: color 0.16s ease;
}

.ranking-card-link:hover .ranking-card-title,
.ranking-card-shell:hover .ranking-card-title,
.ranking-card-shell:hover .ranking-card-title-text {
  color: var(--ifcas-primary);
}

.ranking-card-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  line-height: 1.4;
}

.ranking-card-stat--primary {
  color: #111;
  font-size: 1.1rem;
  font-weight: 800;
}

.ranking-card-stat--highlight {
  margin-bottom: 0.375rem;
  color: #111;
  font-size: 1.1rem;
  font-weight: 800;
}

.ranking-card-stat--secondary {
  color: #6b7280;
  font-size: 0.95rem;
  font-weight: 600;
}

.ranking-card-stat-label {
  font-weight: 600;
}

.ranking-card-stat-link {
  position: relative;
  z-index: 2;
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.ranking-card-stat-link:hover {
  text-decoration: underline;
}

.ranking-post-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: var(--ifcas-primary);
  font-size: 0.95em;
  line-height: 1;
}

.ranking-card-stat--primary .ranking-post-icon {
  color: #374151;
}

.ranking-card-meta {
  margin: 0.375rem 0 0;
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ranking-card-meta-link {
  position: relative;
  z-index: 2;
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.ranking-card-meta-link:hover {
  text-decoration: underline;
}

.ranking-item-title {
  margin: 0 0 0.375rem;
  font-size: 1rem;
}

.ranking-item-meta {
  margin: 0;
  color: #666;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ranking-item-meta + .ranking-item-meta {
  margin-top: 0.125rem;
}

.ranking-separator {
  margin: 0 0.25rem;
  color: #888;
}

.ranking-link {
  font-weight: 600;
  text-decoration: none;
}

.ranking-link:hover {
  text-decoration: underline;
}

.character-post-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--ifcas-primary-dark);
  font-size: 0.875rem;
  font-weight: 600;
}

.character-page-section-title {
  margin: 0 0 0.75rem;
  color: #333;
  font-size: 1.125rem;
}

.actor-type {
  margin: 0.5rem 0 0;
  color: #666;
}

.actor-profile-card {
  margin-bottom: 1.75rem;
}

.actor-profile-type {
  color: #777;
}

.profile-card-type i,
.profile-stat-icon,
.actor-section-icon {
  color: var(--ifcas-primary);
}

.actor-role-ranking {
  margin-bottom: 1.75rem;
}

.actor-role-ranking .section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.actor-role-ranking-card .ranking-card-layout {
  display: block;
  padding: 1.125rem;
}

.actor-role-ranking-title,
.actor-role-ranking-work,
.actor-role-ranking-total {
  display: block;
  width: 100%;
  margin: 0;
}

.actor-role-ranking-title {
  font-size: 1.5rem;
}

.actor-role-ranking-work {
  color: #6b7280;
}

.actor-role-ranking-total {
  color: #374151;
  font-size: 1rem;
  font-weight: 800;
}

.actor-ranked-role {
  font-weight: 600;
}

.actor-ranked-role a {
  color: #333;
  text-decoration: none;
}

.actor-ranked-role a:hover {
  text-decoration: underline;
}

.actor-posts-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#timeline_castings,
#work_timeline_castings,
#character_timeline_castings,
#actor_timeline_castings {
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
}

.casting-list {
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
}

.casting-reason {
  margin: 0 0 0.75rem;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  text-align: left;
}

.casting-type-row {
  margin: 0 0 0.75rem;
}

.casting-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 1.75rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
}

.casting-type-badge__main,
.casting-type-badge__sub {
  display: block;
  line-height: 1.15;
}

.casting-type-badge--voice {
  border-color: var(--ifcas-primary-border);
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary-dark);
}

.casting-type-badge--live_action {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reactions .button_to {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.3;
  padding: 0.625rem 0.875rem;
  text-align: center;
  white-space: nowrap;
}

.btn-reaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
  font-weight: 500;
  width: 100%;
}

.btn-reaction i {
  font-size: 0.95em;
  line-height: 1;
}

.btn-reaction:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.reaction-error {
  margin: 0 0 0.75rem;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 600;
}

.casting-detail-work a,
.casting-detail-question a,
.casting-detail-actor a {
  color: inherit;
  text-decoration: none;
}

.casting-detail-work a:hover,
.casting-detail-question a:hover,
.casting-detail-actor a:hover {
  color: var(--ifcas-primary);
  text-decoration: underline;
}

.casting-detail-reason {
  color: #333;
  font-size: 1rem;
  line-height: 1.8;
}

.casting-detail-reason p {
  margin: 0;
  white-space: pre-wrap;
}

.casting-detail-reason p + p {
  margin-top: 0.75rem;
}

.casting-detail-actions .button_to {
  flex: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.casting-detail-actions .btn-reaction {
  --reaction-accent: #5b5b5b;
  --reaction-soft-bg: rgba(255, 255, 255, 0.76);
  --reaction-border: #b8b8b8;
  --reaction-selected-border: #b8b8b8;
  --reaction-selected-color: #5b5b5b;
  min-height: clamp(2.9rem, 9vw, 3.25rem);
  padding: 0.58rem 0.4rem;
  border: 2px solid var(--reaction-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  color: #5b5b5b;
  font-size: clamp(0.72rem, 2.7vw, 0.9rem);
  font-weight: 850;
  white-space: normal;
}

.casting-detail-actions .btn-reaction--strongly_agree {
  --reaction-accent: #e9491d;
  --reaction-soft-bg: #fff1ec;
  --reaction-border: #e5e7eb;
  --reaction-selected-border: #f0a48e;
  --reaction-selected-color: #c83d17;
}

.casting-detail-actions .btn-reaction--relate {
  --reaction-accent: #2563eb;
  --reaction-soft-bg: #eff6ff;
  --reaction-border: #e5e7eb;
  --reaction-selected-border: #93c5fd;
  --reaction-selected-color: #1d4ed8;
}

.casting-detail-actions .btn-reaction--skeptical {
  --reaction-accent: #6d5f85;
  --reaction-soft-bg: #f5f3ff;
  --reaction-border: #e5e7eb;
  --reaction-selected-border: #c4b5fd;
  --reaction-selected-color: #5b21b6;
}

.casting-detail-actions .btn-reaction span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.casting-detail-actions .btn-reaction i {
  color: var(--reaction-accent);
  font-size: 0.8em;
}

.casting-detail-actions .btn-reaction--selected {
  border-color: var(--reaction-selected-border);
  background: var(--reaction-soft-bg);
  color: var(--reaction-selected-color);
}

.casting-detail-actions .btn-reaction--selected i {
  color: var(--reaction-accent);
}

.casting-detail-actions .btn-reaction:hover {
  border-color: var(--ifcas-primary-border);
  background: #fff;
  color: var(--ifcas-primary-dark);
}

.casting-detail-share {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.casting-share-button,
.casting-share-instagram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
}

.casting-share-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(24rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.18);
}

.casting-share-modal::backdrop {
  background: rgba(17, 24, 39, 0.45);
}

.casting-share-modal-content {
  padding: 1.25rem;
}

.casting-share-modal-title {
  margin: 0 0 1rem;
  color: #444;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.4;
}

.casting-share-modal-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.6;
}

.casting-share-modal-note {
  margin: 0 0 1rem;
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.5;
}

.casting-share-modal-actions {
  display: grid;
  gap: 0.75rem;
}

.casting-share-x-save-button,
.casting-share-x-open-button,
.casting-share-instagram-save-button,
.casting-share-instagram-copy-button,
.casting-share-instagram-open-button,
.casting-share-modal-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  white-space: nowrap;
}

.casting-related-section {
  margin-top: 2rem;
}

.casting-related-section-title {
  margin: 0 0 1rem;
  color: #444;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.4;
}

.casting-related-list {
  display: grid;
  gap: 1rem;
}

.casting-related-more-link {
  display: flex;
  margin-top: 1.25rem;
  margin-inline: auto;
}

.form-card {
  margin-top: 0;
}

.casting-form .form-field {
  margin-bottom: 1rem;
}

.casting-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.casting-form input[type="text"],
.casting-form textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  padding: 0.625rem 0.75rem;
  width: 100%;
}

.casting-form input[type="text"]:focus,
.casting-form textarea:focus {
  border-color: var(--ifcas-primary);
  outline: 2px solid var(--ifcas-primary-ring);
}

.casting-form textarea {
  min-height: 6rem;
  resize: vertical;
}

.casting-type-options {
  display: grid;
  gap: 0.625rem;
}

.casting-type-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 48px;
  padding: 0.75rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.casting-type-option:has(input:checked) {
  border-color: var(--compose-selected-border);
  background: var(--compose-selected-bg);
}

.casting-type-option input {
  accent-color: var(--compose-selected-border);
}

.casting-type-option input {
  flex: 0 0 auto;
  margin: 0;
}

.casting-type-option span {
  font-weight: 700;
}

.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem 0.75rem 2rem;
}

.form-actions {
  margin-top: 1.25rem;
}

.btn-primary {
  background: var(--ifcas-primary);
  border-color: var(--ifcas-primary);
  color: #fff;
  font-weight: 600;
  min-width: 120px;
}

.btn-primary:hover {
  background: var(--ifcas-primary-dark);
  border-color: var(--ifcas-primary-dark);
}

.btn-secondary {
  background: #fff;
  border-color: #9ca3af;
  color: #374151;
  font-weight: 600;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #f3f4f6;
}

.btn-danger {
  background: #fff;
  border-color: #dc2626;
  color: #b91c1c;
  font-weight: 600;
}

.btn-danger:hover {
  background: #fef2f2;
}

.casting-owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0;
}

.casting-owner-actions .button_to {
  margin: 0;
}

@media (max-width: 600px) {
  .page {
    padding: 1rem 0.75rem 2rem;
  }

  .casting-search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .site-search-input-wrap {
    width: 100%;
  }

  .casting-search-button {
    width: 100%;
  }

  h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1rem;
  }

  .official-links-list {
    gap: 0.875rem 1.5rem;
  }

  .reactions {
    flex-direction: column;
  }

  .reactions .button_to {
    flex: 1 1 auto;
    width: 100%;
  }

  .btn-reaction {
    white-space: normal;
  }

  .timeline-card-context-line {
    gap: 0.25rem 0.5rem;
  }

  .timeline-card-context-work {
    font-size: 0.875rem;
  }

  .timeline-card-context-character {
    font-size: 1.25rem;
  }

  .timeline-actor-name {
    font-size: clamp(1.625rem, 9vw, 2rem);
  }

  .timeline-card-detail-link,
  .timeline-card-footer a {
    min-height: 2.75rem;
    font-size: 0.875rem;
  }

  .ranking-card-link,
  .ranking-card-layout {
    padding: 1rem;
    gap: 0.75rem;
  }

  .ranking-rank {
    min-width: 3rem;
    min-height: 2.25rem;
    font-size: 0.9rem;
  }

  .ranking-rank--gold,
  .ranking-rank--silver,
  .ranking-rank--bronze {
    min-width: 3.55rem;
    min-height: 2.45rem;
    font-size: 0.98rem;
  }

  .ranking-card-title {
    font-size: 1.35rem;
  }
}



.casting-search-form {
  display: flex;
  gap: 0.625rem;
  margin: 0;
}

.site-search-form {
  align-items: flex-start;
}

.site-search-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-suggest-panel {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.search-suggest-group + .search-suggest-group {
  border-top: 1px solid #eef2f7;
}

.search-suggest-group-label {
  margin: 0;
  padding: 0.625rem 0.875rem 0.375rem;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 700;
}

.search-suggest-list {
  display: flex;
  flex-direction: column;
}

.search-suggest-item {
  display: block;
  min-height: 2.75rem;
  padding: 0.75rem 0.875rem;
  border-top: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
}

.search-suggest-item:first-child {
  border-top: none;
}

.search-suggest-item:hover,
.search-suggest-item:focus-visible,
.search-suggest-item.is-active {
  background: var(--ifcas-primary-soft);
  outline: none;
}

.search-suggest-item-title {
  display: block;
  color: #111;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.search-suggest-item-subtitle {
  display: block;
  margin-top: 0.25rem;
  color: #6b7280;
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.search-suggest-loading,
.search-suggest-empty {
  margin: 0;
  padding: 0.875rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.casting-search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  font: inherit;
}

.casting-search-input:focus {
  border-color: var(--ifcas-primary);
  outline: 2px solid var(--ifcas-primary-ring);
}

.casting-search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex: 0 0 auto;
  min-width: 80px;
}

.casting-search-button i {
  font-size: 0.95em;
  line-height: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-hero {
  margin: 0 0 1.5rem;
  padding: 2rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #f9fafb 100%);
  text-align: center;
}

.home-hero-logo {
  display: block;
  width: auto;
  height: 180px;
  max-width: min(90vw, 450px);
  margin: 1.75rem auto 2.5rem;
}

.home-hero h1 {
  margin: 0 0 1rem;
  color: #111;
  font-size: clamp(2rem, 9vw, 3.25rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

@media (max-width: 768px) {
  .home-hero h1 {
    font-size: clamp(1.5625rem, 6.5vw, 2.0625rem);
    letter-spacing: -0.06em;
    white-space: nowrap;
  }
}

.home-hero-lead,
.home-hero-text {
  margin: 0 auto;
  max-width: 36rem;
  color: #444;
  font-size: 1rem;
  line-height: 1.8;
}

.home-hero-text {
  margin-top: 0.75rem;
  color: #666;
}

.home-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 24rem);
  min-height: 3.875rem;
  margin-top: 1.625rem;
  padding: 1rem 1.5rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 850;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.home-hero-cta:hover {
  background: #333;
}

.home-explore-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.home-explore-panel {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #fff;
}

.home-explore-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.875rem 1.25rem;
  color: #111;
  font-size: 1rem;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.home-explore-summary::-webkit-details-marker {
  display: none;
}

.home-explore-summary::after {
  content: "\f078";
  color: #9ca3af;
  font-family: "Font Awesome 6 Free";
  font-size: 0.875rem;
  font-weight: 900;
  transition: transform 0.15s ease, color 0.15s ease;
}

.home-explore-panel[open] .home-explore-summary {
  border-bottom: 1px solid #eef2f7;
}

.home-explore-panel[open] .home-explore-summary::after {
  color: var(--ifcas-primary);
  transform: rotate(180deg);
}

.home-explore-panel-body {
  padding: 1rem 1.25rem 1.25rem;
}

.home-explore-lead {
  margin: 0 0 1rem;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.6;
}

.home-explore-panel-body .category-section--main {
  margin-top: 0;
}

.search-page {
  max-width: 42rem;
  margin: 0 auto;
}

.search-page-header {
  margin-bottom: 1.25rem;
}

.search-page-form {
  margin-bottom: 1.5rem;
}

.search-page-empty,
.search-page-query {
  margin: 0 0 1.25rem;
}

.search-page-query {
  color: #374151;
  font-weight: 700;
}

.search-results-group {
  margin-bottom: 1.75rem;
}

.search-results-group-title {
  margin: 0 0 0.75rem;
  color: #111;
  font-size: 1.0625rem;
  font-weight: 850;
}

.search-results-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-result-card {
  display: block;
  min-width: 0;
  padding: 0.875rem 1rem;
  border: 1px solid var(--ifcas-card-border);
  border-radius: 16px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.search-result-card:hover,
.search-result-card:focus {
  border-color: var(--ifcas-primary);
  outline: 2px solid var(--ifcas-primary-ring);
  outline-offset: 2px;
}

.search-result-card__title {
  display: block;
  color: #111;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.search-result-card__meta {
  display: block;
  margin-top: 0.375rem;
  color: #6b7280;
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.search-results-empty {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.casting-type-tabs {
  margin-top: 0;
  margin-bottom: 1rem;
}

.home-timeline-section {
  margin-top: 0.5rem;
}

.home-timeline-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0 0.875rem;
}

.home-timeline-section-icon {
  color: var(--ifcas-primary);
}

.home-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 0 0 12px;
  margin: 0 0 1rem;
  background: #f0f2f5;
  overflow-x: auto;
}

.home-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 999px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  background: #fff;
}

.home-tab.active {
  background: var(--ifcas-primary);
  color: #fff;
  border-color: var(--ifcas-primary);
}

.home-tab:hover {
  border-color: var(--ifcas-primary);
  color: var(--ifcas-primary);
}

.home-tab.active:hover {
  color: #fff;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
}

.timeline-load-more {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  padding: 8px 0 24px;
}

.timeline-load-more-button {
  width: min(100%, 280px);
  text-align: center;
}

.timeline-card {
  position: relative;
  padding: clamp(1.05rem, 4vw, 1.35rem);
  border: 2px solid #d8dee8;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(17, 24, 39, 0.06);
}

.timeline-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
  min-width: 0;
}

.timeline-card-title-group,
.timeline-casting-flow {
  display: flex;
  align-items: center;
  min-width: 0;
}

.timeline-card-title-group {
  flex: 1 1 auto;
  gap: clamp(0.625rem, 2.4vw, 0.875rem);
}

.timeline-casting-flow {
  gap: clamp(0.625rem, 2.6vw, 0.9rem);
  margin-bottom: 1rem;
  padding-left: clamp(0.35rem, 1.4vw, 0.75rem);
}

.timeline-card-badge-row {
  display: inline-flex;
  flex: 0 0 auto;
}

.timeline-card .casting-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(3.75rem, 16vw, 4.75rem);
  min-height: clamp(3.75rem, 16vw, 4.75rem);
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  text-align: center;
  white-space: normal;
  writing-mode: horizontal-tb;
  box-shadow: none;
}

.timeline-card .casting-type-badge__main {
  font-size: clamp(1rem, 4.3vw, 1.35rem);
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1.05;
}

.timeline-card .casting-type-badge__sub {
  margin-top: 0.12rem;
  font-size: clamp(0.62rem, 2.5vw, 0.85rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.05;
}

.timeline-card .casting-type-badge--live_action {
  background: #000;
}

.timeline-card .casting-type-badge--voice {
  background: #5b21b6;
}

.timeline-card-context {
  flex: 1 1 auto;
  min-width: 5.75rem;
}

.timeline-card-context-work-row,
.timeline-card-context-character-row {
  margin: 0;
  line-height: 1.45;
}

.timeline-card-context-character-row {
  margin-top: 0.3rem;
}

.timeline-card-context-work {
  color: #666;
  font-size: clamp(0.95rem, 3.2vw, 1.125rem);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.timeline-card-context-character {
  color: #111;
  font-size: clamp(1.55rem, 7vw, 1.875rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.05;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.timeline-card-context-work:hover,
.timeline-card-context-character:hover {
  color: var(--ifcas-primary);
  text-decoration: none;
}

.timeline-card-flow-arrow {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #9a9a9a;
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  line-height: 1;
}

.timeline-card-actor-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: clamp(2.25rem, 8.5vw, 3rem);
  height: clamp(2.75rem, 10vw, 3.75rem);
  color: #6b7280;
  font-size: clamp(2.25rem, 9vw, 3.25rem);
  line-height: 1;
}

.timeline-card-actor-icon.actor-gender-male {
  color: #2f6fb6;
}

.timeline-card-actor-icon.actor-gender-female {
  color: #d9467f;
}

.timeline-card-actor-icon.actor-gender-non_binary {
  color: #7c3aed;
}

.timeline-card-actor-icon.actor-gender-unknown {
  color: #6b7280;
}

.timeline-card .casting-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.6rem 0 0;
  color: #5b5b5b;
  font-size: clamp(0.8125rem, 2.8vw, 0.95rem);
  font-weight: normal;
}

.timeline-card .casting-author-main {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.55rem;
}

.timeline-card .casting-author-user {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.35rem;
  color: inherit;
  font-weight: normal;
  text-decoration: none;
}

.timeline-card .casting-author-user:hover .casting-author-name {
  text-decoration: underline;
}

.timeline-card .casting-author-icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}

.timeline-card .casting-author-name {
  display: inline-block;
  min-width: 0;
  font-size: clamp(0.8125rem, 2.6vw, 0.9375rem);
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.timeline-card .casting-author-date {
  flex-shrink: 0;
  color: inherit;
  font-size: clamp(0.75rem, 2.6vw, 0.9375rem);
  line-height: 1.4;
  text-align: right;
}

.timeline-actor-name {
  flex: 1 1 auto;
  min-width: min(100%, 8.5rem);
  margin: 0;
  color: #111;
  font-size: clamp(2rem, 10.5vw, 2.625rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.timeline-actor-name a {
  color: inherit;
  text-decoration: none;
}

.timeline-actor-name a:hover {
  color: var(--ifcas-primary);
  text-decoration: none;
}

.timeline-card-comment {
  margin: 0 0 1rem;
}

.timeline-card-comment-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  line-height: 0;
}

.timeline-card-comment-avatar .user-avatar--small {
  width: clamp(2.25rem, 9vw, 3rem);
  height: clamp(2.25rem, 9vw, 3rem);
  background: #5b5b5b;
  color: #fff;
  font-size: clamp(1rem, 3.8vw, 1.3rem);
}

.timeline-card-comment-bubble {
  position: relative;
  border: 2px solid #e8ebef;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.timeline-card .timeline-card-comment-bubble {
  padding: 0.85rem 1rem;
}

.timeline-card-comment-bubble::before {
  content: "";
  position: absolute;
  left: 1.85rem;
  bottom: -0.58rem;
  width: 1rem;
  height: 1rem;
  border-right: 2px solid #e8ebef;
  border-bottom: 2px solid #e8ebef;
  background: inherit;
  transform: rotate(45deg);
}

.timeline-card .timeline-card-comment-bubble .casting-reason {
  margin: 0;
  color: #111;
  font-size: clamp(0.95rem, 3.4vw, 1.2rem);
  line-height: 1.7;
  text-align: left;
  text-indent: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.timeline-card .timeline-card-comment-bubble .casting-reason p {
  margin: 0;
  text-align: left;
  text-indent: 0;
  line-height: 1.7;
}

.timeline-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.4rem, 1.8vw, 0.625rem);
  align-items: stretch;
  margin-top: 1.05rem;
}

.timeline-card-actions .reaction-frame--timeline_card,
.timeline-card-actions .reactions--timeline_card {
  display: contents;
}

.timeline-card-actions .reaction-frame--timeline_card .reaction-error {
  grid-column: 1 / -1;
  margin: 0;
}

.timeline-card-actions .button_to {
  flex: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.timeline-card .btn-reaction {
  --reaction-accent: #5b5b5b;
  --reaction-soft-bg: rgba(255, 255, 255, 0.76);
  --reaction-border: #b8b8b8;
  --reaction-selected-border: #b8b8b8;
  --reaction-selected-color: #5b5b5b;
  min-height: clamp(2.75rem, 9vw, 3.1rem);
  padding: 0.55rem 0.35rem;
  border: 2px solid var(--reaction-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  color: #5b5b5b;
  font-size: clamp(0.68rem, 2.5vw, 0.875rem);
  font-weight: 850;
  white-space: normal;
}

.timeline-card .btn-reaction--strongly_agree {
  --reaction-accent: #e9491d;
  --reaction-soft-bg: #fff1ec;
  --reaction-border: #e5e7eb;
  --reaction-selected-border: #f0a48e;
  --reaction-selected-color: #c83d17;
}

.timeline-card .btn-reaction--relate {
  --reaction-accent: #2563eb;
  --reaction-soft-bg: #eff6ff;
  --reaction-border: #e5e7eb;
  --reaction-selected-border: #93c5fd;
  --reaction-selected-color: #1d4ed8;
}

.timeline-card .btn-reaction--skeptical {
  --reaction-accent: #6d5f85;
  --reaction-soft-bg: #f5f3ff;
  --reaction-border: #e5e7eb;
  --reaction-selected-border: #c4b5fd;
  --reaction-selected-color: #5b21b6;
}

.timeline-card .btn-reaction span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.timeline-card .btn-reaction i {
  color: var(--reaction-accent);
  font-size: 0.8em;
}

.timeline-card .btn-reaction--selected {
  border-color: var(--reaction-selected-border);
  background: var(--reaction-soft-bg);
  color: var(--reaction-selected-color);
}

.timeline-card .btn-reaction--selected i {
  color: var(--reaction-accent);
}

.timeline-card .btn-reaction:hover {
  border-color: var(--ifcas-primary-border);
  background: #fff;
  color: var(--ifcas-primary-dark);
}

.timeline-character-name {
  margin: 0 0 0.5rem;
  color: #111;
  font-size: clamp(1.25rem, 5vw, 1.625rem);
  font-weight: 800;
  line-height: 1.3;
}

.timeline-work-title {
  margin: 0 0 0.375rem;
  color: #666;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}

.timeline-character-name a,
.timeline-work-title a {
  color: inherit;
  text-decoration: none;
}

.timeline-character-name a:hover,
.timeline-work-title a:hover {
  text-decoration: underline;
}

.work-title {
  margin: 0 0 4px;
  color: #666;
  font-size: 13px;
}

.character-name {
  margin: 0;
  font-size: 22px;
}

.category-badge {
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2f2f2;
  font-size: 12px;
  white-space: nowrap;
}

.casting-main {
  margin-bottom: 12px;
}

.casting-label {
  margin: 0 0 4px;
  color: #777;
  font-size: 12px;
}

.actor-name {
  margin: 0 0 12px;
  color: #111;
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 800;
  line-height: 1.3;
}

.casting-question {
  margin: 0 0 10px;
  color: #111;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 750;
  line-height: 1.45;
}

.casting-question a {
  color: inherit;
  text-decoration: none;
}

.casting-question a:hover {
  text-decoration: underline;
}

.casting-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 12px 0;
  color: #777;
  font-size: 12px;
  font-weight: normal;
}

.casting-meta-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  font-weight: normal;
  text-decoration: none;
}

.casting-meta-user:hover {
  text-decoration: underline;
}

.casting-meta-date {
  color: inherit;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #eef2f7;
  color: #64748b;
}

.user-avatar--small {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.75rem;
}

.user-avatar--large {
  width: clamp(6rem, 28vw, 8rem);
  height: clamp(6rem, 28vw, 8rem);
  font-size: clamp(2rem, 8vw, 2.75rem);
}

.user-avatar__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar__fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.user-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.75rem;
  padding: 1.75rem 1.5rem;
  text-align: center;
  border-radius: 18px;
}

.user-profile-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.55rem;
  margin: 1.125rem 0 0.875rem;
}

.user-profile-name {
  margin: 0;
  color: #111;
  font-size: clamp(1.375rem, 5vw, 1.625rem);
  font-weight: 850;
  line-height: 1.3;
}

.user-official-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  vertical-align: middle;
}

.user-official-badge__icon {
  font-size: 0.68rem;
}

.timeline-card .casting-author-user .user-official-badge,
.casting-detail-author-inline .casting-author-user .user-official-badge {
  font-size: clamp(0.65rem, 2.2vw, 0.72rem);
}

.user-profile-bio {
  margin: 0 0 1.125rem;
  max-width: 32rem;
  color: #444;
  font-size: 0.9375rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.user-profile-bio--empty {
  color: #888;
}

.user-profile-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  width: 100%;
  max-width: 24rem;
  margin: 0 0 1.25rem;
  padding: 1rem 0 0;
  border-top: 1px solid #eef2f7;
}

.user-profile-stat {
  margin: 0;
  color: #666;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}

.user-profile-stat__value {
  color: #111;
  font-size: 1.0625rem;
  font-weight: 850;
}

.user-profile-edit-button {
  width: min(100%, 18rem);
}

.user-avatar-field-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.form-help {
  margin: 0.5rem 0 0;
  color: #666;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.form-help--muted {
  color: #888;
}

.user-avatar--medium {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

.casting-meta a {
  color: inherit;
  font-weight: normal;
  text-decoration: none;
}

.casting-meta a:hover {
  text-decoration: underline;
}

.reaction-summary {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
}

.timeline-card-footer {
  display: flex;
  justify-content: stretch;
  margin-top: 0;
}

.timeline-card-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  color: #333;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  background: #f9fafb;
}

.timeline-card-detail-link__label,
.timeline-card-detail-link__icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.timeline-card-detail-link__icon {
  flex-shrink: 0;
  font-size: 0.85em;
  vertical-align: middle;
}

.timeline-card-detail-link:hover {
  background: var(--ifcas-primary-soft);
  border-color: var(--ifcas-primary-border);
  color: var(--ifcas-primary-dark);
}

.timeline-card-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  color: #333;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  background: #f9fafb;
}

.timeline-card-footer a .timeline-card-detail-link__label,
.timeline-card-footer a .timeline-card-detail-link__icon,
.timeline-card-footer a i {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.timeline-card-footer a .timeline-card-detail-link__icon,
.timeline-card-footer a i {
  flex-shrink: 0;
  font-size: 0.85em;
  vertical-align: middle;
}

.timeline-card-footer a:hover {
  background: var(--ifcas-primary-soft);
  border-color: var(--ifcas-primary-border);
  color: var(--ifcas-primary-dark);
}

.timeline-card-header > .timeline-card-detail-link {
  flex: 0 0 auto;
  width: auto;
  min-width: clamp(8rem, 22vw, 10rem);
  min-height: clamp(2.6rem, 8vw, 3rem);
  padding: 0.55rem 1rem;
  border: 2px solid #5f5d5d;
  border-radius: 999px;
  background: #5f5d5d;
  color: #fff;
  font-size: clamp(0.78rem, 2.5vw, 0.95rem);
  font-weight: 850;
  white-space: normal;
}

.timeline-card-header > .timeline-card-detail-link--icon {
  width: clamp(2.75rem, 9vw, 3.25rem);
  min-width: 0;
  min-height: clamp(2.75rem, 9vw, 3.25rem);
  padding: 0;
  border-radius: 999px;
}

.timeline-card-detail-link--icon .timeline-card-detail-link__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.timeline-card-detail-link--icon .timeline-card-detail-link__icon {
  font-size: 1.05rem;
}

.timeline-card-header > .timeline-card-detail-link:hover {
  background: #111;
  border-color: #111;
  color: #fff;
}

@media (max-width: 430px) {
  .timeline-card {
    border-radius: 20px;
  }

  .timeline-card .casting-type-badge {
    width: 3.5rem;
    min-height: 3.5rem;
    padding: 0.4rem 0.35rem;
    border-radius: 12px;
  }

  .timeline-card .casting-type-badge__main {
    font-size: 0.625rem;
    line-height: 1.3;
  }

  .timeline-card .casting-type-badge__sub {
    margin-top: 0.08rem;
    font-size: 0.625rem;
    line-height: 1.3;
  }

  .timeline-card-context-character {
    font-size: 1.125rem;
  }

  .timeline-actor-name {
    font-size: 1.25rem;
  }

  .timeline-card-flow-arrow {
    font-size: 1.25rem;
  }

  .timeline-card-actor-icon {
    width: 1.75rem;
    height: 2.25rem;
    font-size: 2rem;
  }

  .timeline-card-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timeline-card-header {
    gap: 0.625rem;
  }

  .timeline-card-header > .timeline-card-detail-link {
    min-width: 6.5rem;
    padding-inline: 0.75rem;
  }

  .timeline-card-header > .timeline-card-detail-link--icon {
    width: 2.75rem;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0;
  }

  .entity-profile-header__title,
  .work-profile-card .entity-profile-header__title {
    font-size: 1.2rem;
  }

  .work-profile-meta-item,
  .work-profile-meta-sep {
    font-size: 0.75rem;
  }

  .work-profile-synopsis:not(.work-profile-synopsis--empty) {
    font-size: 0.95rem;
  }
}

@media (max-width: 360px) {
  .timeline-card-header {
    flex-wrap: wrap;
  }

  .timeline-card-header > .timeline-card-detail-link {
    margin-left: auto;
  }
}

.category-section {
  margin: 0;
}

.category-section--main {
  margin-top: 1.25rem;
}

.category-section h3 {
  margin-bottom: 12px;
  color: #444;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-link {
  display: block;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid #ddd;
  border-radius: 14px;
  text-decoration: none;
  color: #333;
  background: #fff;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.category-link:hover,
.category-link:focus {
  border-color: var(--ifcas-primary);
  color: var(--ifcas-primary);
  outline: 2px solid var(--ifcas-primary-ring);
  outline-offset: 2px;
}

.category-detail-section {
  margin-bottom: 1.75rem;
}

.category-detail-section .section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-detail-section-icon {
  color: var(--ifcas-primary);
}

.category-popular-work-list,
.category-work-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-popular-work-card,
.category-work-card {
  display: flex;
  min-width: 0;
  border: 1px solid var(--ifcas-card-border);
  border-radius: 16px;
  background: #fff;
  color: #111;
  text-decoration: none;
  box-shadow: var(--ifcas-card-shadow);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.category-popular-work-card:hover,
.category-work-card:hover {
  border-color: var(--ifcas-primary-border);
  background: #fff;
  box-shadow: var(--ifcas-card-hover-shadow);
  transform: translateY(-2px);
}

.category-popular-work-card:hover .category-popular-title,
.category-work-card:hover .category-work-card-title {
  color: var(--ifcas-primary);
}

.category-popular-work-card {
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem;
}

.category-popular-rank {
  flex: 0 0 auto;
  min-width: 2.75rem;
  color: #6b7280;
  font-size: 1.0625rem;
  font-weight: 850;
  line-height: 1.4;
}

.category-popular-rank--first {
  color: var(--ifcas-primary);
}

.category-popular-body,
.category-work-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.category-popular-title,
.category-work-card-title {
  color: #111;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.category-popular-title {
  margin-bottom: 0.375rem;
  font-size: 1.125rem;
}

.category-popular-meta {
  margin-bottom: 0.375rem;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.category-work-groups {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.category-work-group {
  padding: 0;
  overflow: hidden;
}

.category-work-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.875rem 1rem;
  color: #111;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.category-accordion-summary {
  scroll-margin-top: 5rem;
}

.category-work-group-summary::-webkit-details-marker {
  display: none;
}

.category-work-group-summary::after {
  content: "\f078";
  color: #9ca3af;
  font-family: "Font Awesome 6 Free";
  font-size: 0.875rem;
  font-weight: 900;
  transition: transform 0.15s ease, color 0.15s ease;
}

.category-work-group[open] .category-work-group-summary {
  border-bottom: 1px solid #eef2f7;
}

.category-work-group[open] .category-work-group-summary::after {
  color: var(--ifcas-primary);
  transform: rotate(180deg);
}

.category-work-group-count {
  margin-left: auto;
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 700;
}

.category-work-card-list {
  padding: 0.875rem;
}

.category-work-vowel-tabs {
  padding: 0.875rem;
}

.category-work-vowel-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.category-work-vowel-tab-button {
  flex: 1 1 2.75rem;
  min-width: 2.75rem;
  min-height: 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font-size: 0.95rem;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.category-work-vowel-tab-button:hover,
.category-work-vowel-tab-button.is-active {
  border-color: var(--ifcas-primary-border);
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary);
}

.category-work-vowel-panel .category-work-card-list {
  padding: 0;
}

.category-work-card {
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem;
}

.category-work-card-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.95rem;
}

.category-work-card-title {
  margin-bottom: 0.25rem;
  font-size: 1.0625rem;
}

.category-work-card-meta,
.category-work-counts {
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
}

.category-work-card-meta {
  margin-bottom: 0.25rem;
}

.category-work-counts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.category-work-counts i {
  color: #9ca3af;
  font-size: 0.9em;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
}



.error-messages {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 12px;
  background: #fff0f0;
  color: #b00020;
}

.search-select {
  position: relative;
}

.search-hint {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #666;
}

.search-hint--success {
  color: var(--compose-selected-text);
  font-weight: 600;
}

.search-input--pending {
  border-color: var(--compose-pending-border);
  background: var(--compose-pending-bg);
}

.search-input--confirmed {
  border-color: var(--compose-selected-border);
  background: var(--compose-selected-bg);
}

.search-results-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--compose-candidate-border);
  border-radius: 18px;
  background: var(--compose-candidate-surface);
}

.search-results-heading {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 900;
  color: #111;
}

.search-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-results-empty {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
}

.search-result-item {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--compose-candidate-item-border);
  border-radius: 16px;
  background: #fff;
  color: #111;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.search-result-item:hover,
.search-result-item:focus {
  transform: translateY(-1px);
  border-color: #9ca3af;
  background: #fff;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
  outline: none;
}

.selection-confirmed {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
}

.selection-confirmed--actor {
  border: 1px solid var(--compose-selected-border);
  background: var(--compose-selected-bg);
}

.search-new-notice {
  margin: 0.5rem 0 0;
  color: #555;
  font-size: 0.875rem;
  line-height: 1.5;
}

.selection-confirmed-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.selection-confirmed-value {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--compose-selected-text);
}

.site-header {
  width: 100%;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 14px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo-image {
  display: block;
  width: auto;
  height: 46px;
  max-width: 138px;
}

.site-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.site-nav a {
  color: #111;
}

.logout-button {
  border: none;
  background: none;
  padding: 0;
  color: #111;
  text-decoration: underline;
  cursor: pointer;
}

.user-menu {
  position: relative;
}

.user-menu-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.user-menu-summary::-webkit-details-marker {
  display: none;
}

.user-menu-summary:hover,
.user-menu[open] .user-menu-summary {
  border-color: var(--ifcas-primary-border);
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
  transform: translateY(-1px);
}

.user-menu-summary .user-avatar--small {
  width: 2rem;
  height: 2rem;
  font-size: 0.85rem;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  z-index: 20;
  display: flex;
  min-width: 13rem;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.12);
}

.user-menu-account {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.6rem 0.7rem;
  border-bottom: 1px solid #f1f2f4;
  color: #111;
}

.user-menu-account .user-avatar--small {
  width: 2rem;
  height: 2rem;
  font-size: 0.85rem;
}

.user-menu-account-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.25rem;
}

.user-menu-link,
.user-menu-logout-button {
  display: grid;
  width: 100%;
  grid-template-columns: 1.15rem 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.68rem 0.7rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-menu-logout-form {
  margin: 0.25rem 0 0;
}

.user-menu-icon {
  width: 1.15rem;
  color: #8a8f98;
  font-size: 0.9rem;
  text-align: center;
  transition: color 0.15s ease;
}

.user-menu-link:hover,
.user-menu-logout-button:hover {
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary);
  text-decoration: none;
}

.user-menu-link:hover .user-menu-icon,
.user-menu-logout-button:hover .user-menu-icon {
  color: var(--ifcas-primary);
}

.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-menu {
  position: relative;
}

.site-menu-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  list-style: none;
}

.site-menu-summary::-webkit-details-marker {
  display: none;
}

.site-menu-summary-icon {
  color: #6b7280;
  font-size: 1.05rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.site-menu-summary:hover .site-menu-summary-icon,
.site-menu-summary:focus .site-menu-summary-icon,
.site-menu[open] .site-menu-summary-icon {
  color: var(--ifcas-primary);
}

.site-menu-summary:hover,
.site-menu-summary:focus,
.site-menu[open] .site-menu-summary {
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
  outline: none;
}

.site-menu-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  z-index: 20;
  display: flex;
  min-width: 15.5rem;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.12);
}

.site-menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-menu-link {
  display: grid;
  width: 100%;
  grid-template-columns: 1.15rem 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.68rem 0.7rem;
  border-radius: 12px;
  background: transparent;
  color: #111;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-menu-icon {
  color: #6b7280;
  font-size: 0.92rem;
  text-align: center;
  transition: color 0.15s ease;
}

.site-menu-link:hover,
.site-menu-link:focus {
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary-dark);
  outline: none;
}

.site-menu-link:hover .site-menu-icon,
.site-menu-link:focus .site-menu-icon {
  color: var(--ifcas-primary);
}

.site-menu-link--active {
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary);
}

.site-menu-link--active .site-menu-icon {
  color: var(--ifcas-primary);
}

.site-menu-link__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  min-width: 0;
  width: 100%;
}

.site-menu-link__label-text {
  min-width: 0;
}

.notice,
.alert {
  max-width: 640px;
  margin: 12px auto;
  padding: 10px 14px;
}

.submit-button {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: var(--ifcas-primary);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.submit-button:hover {
  opacity: 0.9;
}

.submit-button:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 1;
}

.user-profile-link {
  color: #111;
  font-weight: 600;
  text-decoration: none;
}

.user-profile-link:hover {
  text-decoration: underline;
}

.welcome-user {
  color: #666;
  font-size: 13px;
}

.user-profile-link {
  color: #111;
  font-weight: 600;
  text-decoration: none;
}

.user-profile-link:hover {
  text-decoration: underline;
}

/* Auth (Devise login / registration) */

.auth-page {
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 4vw, 1.5rem) clamp(0.75rem, 4vw, 1rem) clamp(2.25rem, 5vw, 3rem);
}

.auth-card {
  width: min(100%, 26rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 1.75rem) clamp(1.125rem, 4vw, 1.5rem) clamp(1.25rem, 3.5vw, 1.5rem);
  border: 2px solid var(--ifcas-card-border);
  border-radius: 24px;
  box-shadow: var(--ifcas-card-shadow);
  background: #fff;
}

.auth-card-header {
  margin-bottom: clamp(1rem, 3vw, 1.2rem);
  text-align: center;
}

.auth-card-title {
  margin: 0 0 0.55rem;
  font-size: clamp(1.625rem, 6vw, 1.95rem);
  font-weight: 900;
  line-height: 1.35;
  color: #111;
}

.auth-brand-i {
  color: var(--ifcas-primary);
}

.auth-card-lead {
  margin: 0;
  color: #6b7280;
  font-size: clamp(0.875rem, 3.2vw, 0.9375rem);
  line-height: 1.7;
}

.auth-form .form-group {
  margin-bottom: clamp(1rem, 3vw, 1.125rem);
}

.auth-form .form-group label {
  display: block;
  margin-bottom: 0.45rem;
  color: #374151;
  font-size: clamp(0.875rem, 3vw, 0.9375rem);
  font-weight: 700;
}

.auth-field-hint {
  margin: -0.15rem 0 0.5rem;
  color: #6b7280;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.auth-form .auth-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #111;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form .auth-input::placeholder {
  color: #9ca3af;
}

.auth-form .auth-input:focus {
  border-color: var(--ifcas-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--ifcas-primary-ring);
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
  color: #4b5563;
  font-size: 0.9375rem;
}

.auth-checkbox {
  appearance: none;
  display: inline-grid;
  place-content: center;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border: 1.5px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-checkbox::before {
  content: "";
  width: 0.42rem;
  height: 0.7rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.auth-checkbox:checked {
  border-color: var(--ifcas-primary);
  background: var(--ifcas-primary);
}

.auth-checkbox:checked::before {
  opacity: 1;
}

.auth-checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ifcas-primary-ring);
}

.auth-remember label {
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}

.auth-form-actions {
  margin-top: clamp(1.25rem, 4vw, 1.375rem);
}

.auth-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.875rem 1.25rem;
  border: 2px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit-button:hover,
.auth-submit-button:focus {
  background: #2b2b2b;
  border-color: #2b2b2b;
  color: #fff;
  outline: none;
}

.auth-submit-button:focus-visible {
  box-shadow: 0 0 0 3px var(--ifcas-primary-ring);
}

.auth-links {
  margin-top: clamp(1.25rem, 4vw, 1.5rem);
  padding-top: clamp(1rem, 3.5vw, 1.25rem);
  border-top: 1px solid #f3f4f6;
}

.auth-links-item {
  margin: 0 0 0.75rem;
  color: #6b7280;
  font-size: 0.9375rem;
  line-height: 1.6;
  text-align: center;
}

.auth-links-item:last-child {
  margin-bottom: 0;
}

.auth-link {
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus {
  color: var(--ifcas-primary);
  text-decoration: underline;
}

.auth-link:focus-visible {
  outline: 2px solid var(--ifcas-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.auth-link--standalone {
  display: inline-block;
}

.auth-oauth-button {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.auth-oauth-button:hover,
.auth-oauth-button:focus {
  border-color: var(--ifcas-primary-border);
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary-dark);
  outline: none;
}

.auth-errors {
  margin: 0 0 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
  color: #991b1b;
}

.auth-errors-title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

.auth-errors-list {
  margin: 0;
  padding-left: 1.125rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

@media (max-width: 430px) {
  .auth-page {
    padding-top: 0.85rem;
    padding-bottom: 2.25rem;
  }

  .auth-card {
    padding: 1.375rem 1rem 1.25rem;
    border-radius: 22px;
  }

  .auth-card-title {
    font-size: clamp(1.55rem, 7vw, 1.8rem);
  }

  .auth-form .auth-input,
  .auth-submit-button {
    min-height: 3rem;
  }
}



.user-avatar__fallback {
  font-weight: 850;
  letter-spacing: 0.02em;
}

.user-profile-reactions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
  width: 100%;
  max-width: 34rem;
  margin: 0 0 1.25rem;
}

.user-profile-reaction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.3;
}

.user-profile-reaction__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.user-profile-reaction__label i {
  flex-shrink: 0;
}

.user-profile-reaction__value {
  flex-shrink: 0;
  color: #111;
  font-size: 1rem;
  font-weight: 900;
}

.user-profile-reaction--strongly_agree i,
.user-profile-reaction--strongly_agree .user-profile-reaction__value {
  color: var(--ifcas-primary);
}

.user-profile-reaction--relate i,
.user-profile-reaction--relate .user-profile-reaction__value {
  color: #2563eb;
}

.user-profile-reaction--skeptical i,
.user-profile-reaction--skeptical .user-profile-reaction__value {
  color: #6d5a7d;
}

@media (max-width: 560px) {
  .user-profile-reactions {
    grid-template-columns: 1fr;
  }

  .user-profile-reaction {
    min-height: 3rem;
  }
}

/* Casting compose flow */
.casting-flow-card {
  padding: 20px;
  border-radius: 24px;
}

.casting-flow-card .form-control:focus,
.casting-flow-card .search-input:focus {
  border-color: #9ca3af;
  outline: 2px solid rgba(107, 114, 128, 0.18);
  outline-offset: 0;
}

.casting-flow-card .character-suggestions-summary::after {
  color: #6b7280;
}

.casting-flow-card .character-suggestion-card:hover,
.casting-flow-card .character-suggestion-card:focus {
  border-color: #9ca3af;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.casting-flow-card .character-suggestions-more:hover,
.casting-flow-card .character-suggestions-more:focus,
.casting-flow-card .manual-character-button:hover,
.casting-flow-card .manual-character-button:focus {
  border-color: #111;
  color: #111;
  outline: 2px solid rgba(17, 24, 39, 0.08);
  outline-offset: 2px;
}

.casting-compose-section {
  margin-top: 20px;
}

.casting-compose-section:first-of-type {
  margin-top: 0;
}

.casting-compose-actions {
  margin-top: 24px;
}

.casting-compose-note {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.casting-draft-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--compose-selected-border);
  border-radius: 12px;
  background: var(--compose-selected-bg);
}

.casting-draft-notice[hidden] {
  display: none;
}

.casting-draft-notice__text {
  margin: 0;
  color: var(--compose-selected-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
}

.casting-draft-notice__discard {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--compose-candidate-item-border);
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.casting-draft-notice__discard:hover,
.casting-draft-notice__discard:focus {
  border-color: #9ca3af;
  outline: none;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-result-item--actor {
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
}

.search-result-actor-icon {
  display: inline-flex;
  width: 1.25rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.search-result-actor-icon.actor-gender-male {
  color: #2563eb;
}

.search-result-actor-icon.actor-gender-female {
  color: #db2777;
}

.search-result-actor-icon.actor-gender-non_binary,
.search-result-actor-icon.actor-gender-unknown {
  color: #6b7280;
}

.search-result-title {
  color: #111;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.search-result-meta {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.character-suggestions {
  margin-top: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fafafa;
  overflow: hidden;
}

.character-suggestions-summary {
  position: relative;
  padding: 14px 42px 14px 16px;
  color: #111;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.character-suggestions-summary::-webkit-details-marker {
  display: none;
}

.character-suggestions-summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ifcas-primary);
  font-size: 18px;
  font-weight: 900;
}

.character-suggestions[open] .character-suggestions-summary {
  border-bottom: 1px solid #e5e7eb;
}

.character-suggestions[open] .character-suggestions-summary::after {
  content: "−";
}

.character-suggestions-content {
  padding: 16px;
}

.character-suggestions-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.character-suggestions-header p {
  margin: 0;
  color: #111;
  font-size: 15px;
  font-weight: 900;
}

.character-suggestions-header span {
  flex-shrink: 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.character-suggestion-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.character-suggestion-card {
  min-height: 68px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: #fff;
  color: #111;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.character-suggestion-card:hover,
.character-suggestion-card:focus {
  transform: translateY(-1px);
  border-color: var(--ifcas-primary);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
  outline: none;
}

.character-suggestion-card span {
  display: block;
  color: #111;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.character-suggestion-card small {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.character-suggestions-more,
.manual-character-button {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.character-suggestions-more:hover,
.character-suggestions-more:focus,
.manual-character-button:hover,
.manual-character-button:focus {
  border-color: var(--ifcas-primary);
  color: var(--ifcas-primary);
  outline: 2px solid var(--ifcas-primary-ring);
  outline-offset: 2px;
}

.manual-character-button--sub {
  margin-top: 14px;
}

.character-suggestions-empty {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.casting-complete-card {
  margin-bottom: clamp(1rem, 4vw, 1.25rem);
  padding: clamp(1.15rem, 4vw, 1.5rem);
  border: 2px solid var(--ifcas-primary-border);
  background: linear-gradient(165deg, #fff9f3 0%, #fff 58%);
  border-radius: 24px;
  box-shadow: var(--ifcas-card-shadow);
}

.casting-complete-kicker {
  margin: 0 0 0.5rem;
  color: var(--ifcas-primary);
  font-size: clamp(0.8125rem, 3vw, 0.875rem);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.casting-complete-card h2 {
  margin: 0;
  color: #111;
  font-size: clamp(1.2rem, 5vw, 1.375rem);
  font-weight: 900;
  line-height: 1.4;
}

.casting-complete-card p {
  color: #4b5563;
  line-height: 1.7;
}

.casting-complete-discovery {
  margin-bottom: 18px;
}

.casting-detail-card + .casting-complete-discovery,
.casting-detail-card + .same-character-related-section,
.casting-detail-card + .casting-related-section {
  margin-top: clamp(1.75rem, 5vw, 2.25rem);
}

.casting-complete-discovery-title {
  margin: 0 0 1rem;
  font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  line-height: 1.45;
  color: #111;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.casting-complete-discovery-subject {
  font-weight: 900;
}

.casting-complete-more-link {
  display: flex;
  margin-top: 1.25rem;
  margin-inline: auto;
}

@media (max-width: 420px) {
  .casting-flow-card {
    padding: 16px;
  }

  .character-suggestion-list {
    grid-template-columns: 1fr;
  }
}

/* Stage 2 UI refinements */
.timeline-card-comment-avatar {
  color: inherit;
  text-decoration: none;
}

.timeline-card-comment-avatar:hover .user-avatar,
.timeline-card-comment-avatar:focus .user-avatar {
  outline: 2px solid var(--ifcas-primary-ring);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .timeline-actor-name {
    font-size: clamp(1.85rem, 4.6vw, 2.25rem);
  }
}

@media (max-width: 430px) {
  .timeline-card .casting-type-badge__main {
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .timeline-card .casting-type-badge__sub {
    font-size: 0.68rem;
    line-height: 1.15;
  }
}

/* Category detail search */
.category-work-search {
  margin: 0 0 16px;
  padding: 18px;
  border-radius: 22px;
}

.category-work-search label {
  display: block;
  margin-bottom: 10px;
  color: #111;
  font-size: 1rem;
  font-weight: 900;
}

.category-work-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
}

.category-work-search-form:focus-within {
  border-color: var(--ifcas-primary);
  box-shadow: 0 0 0 3px var(--ifcas-primary-ring);
}

.category-work-search-form i {
  color: #6b7280;
}

.category-work-search-form input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #111;
  font-size: 1rem;
}

.category-work-search-help {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.6;
}

.category-work-search-results {
  margin-top: 14px;
}

.category-work-search-result-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.category-work-search-result-card {
  border-color: var(--ifcas-primary-border);
  background: var(--ifcas-primary-soft);
}

.category-work-search-empty {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Casting card excerpt and detail reading page */
.same-character-related-section {
  margin-top: clamp(1.5rem, 4vw, 2rem);
}

.same-character-related-lead {
  margin: -4px 0 14px;
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.6;
}

.same-character-related-title {
  margin: 0 0 0.75rem;
  color: #111;
  font-size: 1.2rem;
  font-weight: 900;
}

.casting-reason-more-link {
  display: inline;
  margin-left: 0.35rem;
  color: #111;
  font-size: inherit;
  font-weight: 900;
  line-height: 1.7;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: baseline;
}

.casting-reason-more-link::after {
  content: "→";
  margin-left: 0.35rem;
}

.casting-reason-more-link:hover,
.casting-reason-more-link:focus {
  color: var(--ifcas-primary);
  text-decoration: none;
}

.casting-detail-reason--full {
  padding: clamp(1rem, 4vw, 1.35rem);
  border: 2px solid #e8ebef;
  border-left: 4px solid #111;
  border-radius: 18px;
  background: #fff;
  color: #111;
  font-size: clamp(1rem, 3.5vw, 1.125rem);
  line-height: 1.9;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

/* Casting detail as an expanded timeline card */
.casting-detail-card {
  padding: clamp(1.1rem, 4vw, 1.5rem);
  border: 2px solid #d1d5db;
  border-radius: 26px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.casting-detail-hero--card-like {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
  text-align: center;
}

.casting-detail-type-band {
  width: 100%;
  max-width: 14rem;
  margin: 0 auto clamp(0.85rem, 3vw, 1.1rem);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: #fff;
  font-size: clamp(0.8125rem, 3vw, 0.9375rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.35;
  text-align: center;
}

.casting-detail-type-band--live_action {
  background: #1f2937;
}

.casting-detail-type-band--voice {
  background: #6d28d9;
}

.casting-detail-hero--card-like .casting-detail-context {
  width: 100%;
  min-width: 0;
}

.casting-detail-hero--card-like .casting-detail-work {
  margin: 0 0 0.4rem;
  color: #666;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.casting-detail-hero--card-like .casting-detail-question {
  margin: 0;
  color: #111;
  font-size: clamp(1.75rem, 8vw, 2.45rem);
  font-weight: 950;
  letter-spacing: -0.05em;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.casting-detail-role {
  margin: 0.45rem 0 0;
  color: #5b5b5b;
  font-size: clamp(1rem, 4vw, 1.25rem);
  font-weight: 900;
  line-height: 1.35;
}

.casting-detail-actor-row {
  justify-content: center;
  width: 100%;
  margin-top: clamp(1.35rem, 5vw, 1.75rem);
  padding-left: 0;
}

.casting-detail-actor-row .timeline-card-actor-icon {
  width: clamp(2.25rem, 8.5vw, 3rem);
  height: clamp(2.75rem, 10vw, 3.75rem);
  font-size: clamp(2.25rem, 9vw, 3.25rem);
}

.casting-detail-hero--card-like .casting-detail-actor {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.9rem, 8.5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.casting-detail-comment {
  margin: clamp(1.25rem, 4.5vw, 1.65rem) 0 1rem;
}

.casting-detail-comment-bubble {
  padding: 0.85rem 1rem;
  border-color: #e8ebef;
  background: rgba(255, 255, 255, 0.72);
}

.casting-detail-comment-bubble .casting-detail-reason--full {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.casting-detail-comment-bubble .casting-detail-reason--full p {
  margin: 0;
  color: #111;
  font-size: clamp(1rem, 3.5vw, 1.1rem);
  line-height: 1.8;
}

.casting-detail-comment-bubble .casting-detail-reason--full p + p {
  margin-top: 0.65rem;
}

.casting-detail-author-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
  color: #6b7280;
}

.casting-detail-author-inline .casting-author-main,
.casting-detail-author-inline .casting-author-user {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.55rem;
}

.casting-detail-author-inline .casting-author-user {
  color: inherit;
  font-weight: normal;
  text-decoration: none;
}

.casting-detail-author-inline .casting-author-user:hover .casting-author-name {
  color: #111;
  text-decoration: underline;
}

.casting-detail-author-inline .casting-author-name {
  font-size: clamp(0.8125rem, 2.5vw, 0.875rem);
  font-weight: 650;
  color: #374151;
  overflow-wrap: anywhere;
}

.casting-detail-author-inline .casting-author-date {
  flex-shrink: 0;
  font-size: clamp(0.75rem, 2.6vw, 0.875rem);
  color: #9ca3af;
  text-align: right;
}

.casting-detail-actions {
  margin-top: clamp(1rem, 4vw, 1.25rem);
}

.casting-detail-actions .btn-reaction {
  min-height: clamp(2.9rem, 9vw, 3.25rem);
}

.casting-detail-owner-section {
  margin-top: clamp(1rem, 3.5vw, 1.25rem);
  padding-top: clamp(0.85rem, 3vw, 1rem);
  border-top: 1px solid #e5e7eb;
}

.casting-detail-owner-section .casting-owner-actions {
  justify-content: center;
  gap: 0.5rem;
}

.casting-detail-owner-section .btn,
.casting-detail-owner-section .button_to {
  min-width: min(100%, 9.5rem);
}

.casting-detail-owner-section .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.casting-detail-owner-section .btn-danger {
  border-color: #d1d5db;
  color: #6b7280;
}

.casting-detail-owner-section .btn-danger:hover {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fef2f2;
}

.casting-complete-discovery.ranking-section {
  margin-bottom: 1rem;
}

.casting-complete-discovery.ranking-section--compact {
  margin-bottom: 1.75rem;
}

@media (max-width: 430px) {
  .casting-detail-card {
    padding: 1.15rem 1rem 1.25rem;
  }

  .casting-detail-type-band {
    max-width: 12.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
  }

  .casting-detail-hero--card-like .casting-detail-question {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .casting-detail-hero--card-like .casting-detail-actor {
    font-size: clamp(1.7rem, 7.5vw, 2.35rem);
  }

  .casting-detail-author-inline {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .casting-detail-author-inline .casting-author-date {
    width: 100%;
    padding-left: calc(clamp(2.25rem, 9vw, 3rem) + 0.55rem);
    text-align: left;
  }
}

/* Ranking page header */
.ranking-page-header,
.category-page-header,
.static-page-header {
  margin: 0 0 1.25rem;
  padding: 0.25rem 0 0.5rem;
}

.ranking-page-kicker,
.category-page-kicker,
.static-page-kicker {
  margin: 0 0 0.35rem;
  color: var(--ifcas-primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranking-page-header .page-title,
.category-page-header .page-title,
.static-page-header .page-title {
  margin-bottom: 0.4rem;
}

.ranking-page-lead,
.category-page-lead,
.static-page-lead {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.7;
}

.static-page-main-copy-heading {
  margin: 0 0 0.5rem;
  color: #111;
  font-size: 1.125rem;
  font-weight: 850;
  line-height: 1.4;
}

.static-page-main-copy-text {
  margin-top: 0.5rem;
}

/* Information pages */
.information-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.information-category-tab {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #444;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.information-category-tab:hover,
.information-category-tab:focus {
  border-color: var(--ifcas-primary-border);
  color: var(--ifcas-primary);
  outline: none;
}

.information-category-tab--active {
  border-color: var(--ifcas-primary);
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary);
}

.information-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.information-card {
  display: block;
  padding: 1.1rem 1.15rem;
  border: 2px solid var(--ifcas-card-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--ifcas-card-shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.information-card:hover,
.information-card:focus {
  border-color: var(--ifcas-primary-border);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.information-card-meta,
.information-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.information-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--information-category-color) 12%, white);
  color: var(--information-category-color);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
}

.information-category-badge-icon {
  font-size: 0.72rem;
}

.information-notification-reason-badge {
  display: inline;
  margin-right: 0.15rem;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.information-card-date,
.information-detail-date {
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 700;
}

.information-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ifcas-primary);
  font-size: 0.78rem;
  font-weight: 850;
}

.information-card-title {
  margin: 0 0 0.45rem;
  color: #111;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.45;
}

.information-card-excerpt {
  margin: 0;
  color: #666;
  font-size: 0.92rem;
  line-height: 1.7;
}

.information-detail-card {
  padding: 1.25rem 1.2rem;
  border: 2px solid var(--ifcas-card-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--ifcas-card-shadow);
}

.information-detail-title {
  margin: 0;
  color: #111;
  font-size: clamp(1.25rem, 4.5vw, 1.65rem);
  font-weight: 900;
  line-height: 1.35;
}

.information-detail-body {
  margin-top: 1.1rem;
  color: #333;
  font-size: 0.98rem;
  line-height: 1.85;
}

.information-detail-body p {
  margin: 0 0 0.85rem;
}

.information-detail-body p:last-child {
  margin-bottom: 0;
}

/* Admin shell */
.admin-body {
  background: #f8fafc;
}

.admin-header {
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.admin-header-logo-image {
  display: block;
  height: 40px;
  width: auto;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-header-link,
.admin-header-logout {
  color: #111;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-header-logout {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.admin-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #444;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-nav-link--active {
  border-color: var(--ifcas-primary);
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary);
}

.admin-nav-link--secondary {
  color: #6b7280;
}

.admin-main {
  min-width: 0;
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-page-title {
  margin: 0;
  color: #111;
  font-size: 1.35rem;
  font-weight: 900;
}

.admin-card {
  padding: 1rem;
  border: 2px solid var(--ifcas-card-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--ifcas-card-shadow);
}

.admin-form-card {
  padding: 1.25rem;
}

.admin-flash {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-flash--notice {
  background: #ecfdf5;
  color: #047857;
}

.admin-flash--alert {
  background: #fff1f2;
  color: #be123c;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #f1f2f4;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-table-link {
  color: var(--ifcas-primary);
  font-weight: 800;
  text-decoration: none;
}

.admin-table-button {
  border: 0;
  background: transparent;
  color: #be123c;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-inline-form {
  display: inline;
}

.admin-empty {
  margin: 0;
  color: #6b7280;
}

.admin-status-badge {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
}

.admin-status-badge--draft {
  background: #f3f4f6;
  color: #4b5563;
}

.admin-status-badge--published {
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary);
}

.admin-color-chip {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  vertical-align: middle;
}

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.admin-button--primary {
  background: #111;
  color: #fff;
}

.admin-button--primary:hover {
  background: #333;
  color: #fff;
}

.admin-button--secondary {
  border-color: #e5e7eb;
  background: #fff;
  color: #111;
}

.admin-form-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-form-hint {
  margin: 0.35rem 0 0;
  color: #6b7280;
  font-size: 0.8rem;
  line-height: 1.5;
}

.admin-form-errors {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #fff1f2;
  color: #be123c;
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.operation-form-card {
  padding: 1.25rem;
  border: 1px solid var(--ifcas-card-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--ifcas-card-shadow);
}

.operation-form {
  display: grid;
  gap: 1rem;
}

.operation-form-field {
  display: grid;
  gap: 0.4rem;
}

.operation-form-field label,
.operation-form-check {
  color: #374151;
  font-size: 0.9rem;
  font-weight: 800;
}

.operation-form-input {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.operation-form-input:focus {
  border-color: var(--ifcas-primary);
  box-shadow: 0 0 0 4px var(--ifcas-primary-ring);
  outline: none;
}

.operation-form-textarea {
  min-height: 11rem;
  resize: vertical;
}

.operation-form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fafafa;
  line-height: 1.6;
}

.operation-form-check input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.22rem;
  accent-color: var(--ifcas-primary);
}

.operation-form-note {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--ifcas-primary-border);
  border-radius: 14px;
  background: var(--ifcas-primary-soft);
  color: #374151;
  font-size: 0.86rem;
  line-height: 1.7;
}

.operation-form-submit,
.operation-form-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 1.25rem;
  border: 2px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.operation-form-submit:hover,
.operation-form-submit:focus,
.operation-form-secondary-link:hover,
.operation-form-secondary-link:focus {
  background: var(--ifcas-primary);
  border-color: var(--ifcas-primary);
  color: #fff;
  outline: none;
  transform: translateY(-1px);
}

.operation-form-errors {
  padding: 0.85rem 1rem;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.875rem;
}

.operation-form-errors p {
  margin: 0 0 0.35rem;
  font-weight: 800;
}

.operation-form-errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

.operation-form-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.operation-thanks-card {
  display: grid;
  gap: 1rem;
  text-align: center;
}

.operation-thanks-card p {
  margin: 0;
  color: #374151;
  line-height: 1.8;
}

.site-header-inner--centered {
  justify-content: center;
}

.global-nav {
  position: fixed;
  right: 0;
  bottom: calc(0.85rem + env(safe-area-inset-bottom) - 5px);
  left: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 10vw, 3rem);
  padding: 0 1rem;
  pointer-events: none;
}

/* 右下固定アクションボタン（メニュー・アバター・投稿） */
.floating-action-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  overflow: visible;
  width: var(--fab-size-mobile);
  height: var(--fab-size-mobile);
  min-width: var(--fab-size-mobile);
  min-height: var(--fab-size-mobile);
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
  list-style: none;
  text-align: center;
  text-decoration: none;
  pointer-events: auto;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}

.floating-action-button:hover,
.floating-action-button:focus,
.global-nav-menu[open] > .floating-action-button {
  box-shadow: none;
  outline: none;
}

.floating-action-button:active {
  box-shadow: none;
  opacity: 0.92;
}

.floating-action-button--bordered {
  border: var(--fab-border-width) solid var(--fab-border-color);
  background: #fff;
  color: #111827;
}

.floating-action-button--bordered:hover,
.floating-action-button--bordered:focus,
.global-nav-menu[open] > .floating-action-button--bordered {
  border-color: var(--fab-border-color-hover);
  background: #fff;
  color: var(--ifcas-primary);
}

.floating-action-button--bordered:active {
  opacity: 1;
  background: #fafafa;
}

.floating-action-button--post {
  border: none;
  background: var(--ifcas-primary);
  color: #fff;
}

.floating-action-button--post:hover,
.floating-action-button--post:focus {
  background: var(--ifcas-primary-dark);
  color: #fff;
}

.menu-unread-badge,
.floating-action-button__unread-badge {
  display: none;
  flex-shrink: 0;
  width: var(--fab-badge-size);
  height: var(--fab-badge-size);
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e53935;
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(229, 57, 53, 0.28);
}

.menu-unread-badge--visible,
.floating-action-button__unread-badge--visible,
.menu-unread-badge[hidden="false"],
.floating-action-button__unread-badge[hidden="false"] {
  display: block;
}

.menu-unread-badge[hidden],
.floating-action-button__unread-badge[hidden] {
  display: none !important;
}

.menu-unread-badge--fab,
.floating-action-button--menu > .menu-unread-badge,
.floating-action-button--menu > .floating-action-button__unread-badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  transform: translate(35%, -35%);
}

.menu-unread-badge--menu-item {
  position: static;
  transform: none;
  border-width: 1.5px;
}

.floating-action-button::-webkit-details-marker {
  display: none;
}

.global-nav-icon,
.global-nav-mark-icon {
  display: inline-flex;
  width: 1.65rem;
  height: 1.65rem;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
}

.global-nav-mark-image {
  display: block;
  width: 1.9rem;
  height: 1.9rem;
  object-fit: contain;
}

.global-nav-mark-icon {
  width: 1.9rem;
  height: 1.9rem;
  color: var(--ifcas-primary);
}

.global-nav-mark-icon svg {
  display: block;
  width: 1.9rem;
  height: 1.9rem;
}

.global-nav-avatar {
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}

.global-nav-avatar .user-avatar,
.global-nav-avatar .user-avatar--small {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  font-size: 1rem;
}

.global-nav-avatar .user-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.global-nav-menu {
  position: relative;
  min-width: 0;
  pointer-events: auto;
}

.global-nav-panel {
  position: fixed;
  right: 1rem;
  bottom: calc(5.3rem + env(safe-area-inset-bottom));
  left: 1rem;
  z-index: 70;
  display: grid;
  gap: 0.5rem;
  max-height: min(70vh, 32rem);
  overflow-y: auto;
  padding: 0.65rem;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--fab-panel-shadow);
}

.global-nav-panel-section {
  display: grid;
  gap: 0.2rem;
}

.site-menu-logout-form {
  margin: 0;
}

.site-menu-logout-button {
  display: grid;
  width: 100%;
  grid-template-columns: 1.15rem 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.68rem 0.7rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-menu-logout-button:hover,
.site-menu-logout-button:focus {
  background: var(--ifcas-primary-soft);
  color: var(--ifcas-primary-dark);
  outline: none;
}

.site-menu-logout-button:hover .site-menu-icon,
.site-menu-logout-button:focus .site-menu-icon {
  color: var(--ifcas-primary);
}

.global-nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

body {
  padding-bottom: calc(4.7rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .global-nav {
    right: 24px;
    bottom: 24px;
    left: auto;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0;
  }

  .floating-action-button {
    width: var(--fab-size-desktop);
    height: var(--fab-size-desktop);
    min-width: var(--fab-size-desktop);
    min-height: var(--fab-size-desktop);
  }

  .global-nav-icon {
    width: 1.6rem;
    height: 1.6rem;
  }

  .global-nav-mark-icon,
  .global-nav-mark-icon svg,
  .global-nav-mark-image {
    width: 1.85rem;
    height: 1.85rem;
  }

  .global-nav-panel {
    position: absolute;
    right: calc(100% + 0.85rem);
    bottom: 0;
    left: auto;
    width: 16.5rem;
    max-height: min(75vh, 34rem);
  }
}

.posting-guidelines-page h2 {
  margin-top: 2.6rem;
  padding-top: 1.75rem;
}

.posting-guidelines-page h2:first-of-type {
  margin-top: 2.2rem;
}

.posting-guidelines-heading-icon {
  margin-right: 0.45rem;
  color: var(--ifcas-primary);
  font-size: 0.95em;
}

.global-nav-panel-section + .global-nav-panel-section {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f3f4f6;
}

.global-nav-panel-heading {
  margin: 0 0 0.25rem;
  padding: 0 0.7rem;
  color: #9ca3af;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
