.ribbon { display: block; border-radius: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.ribbon-rack { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 160px; margin: 2px auto 0; }
.ribbon-rack:hover { text-decoration: none; filter: brightness(1.1); }
.medal-emblem { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; }
.medal-emblem img, .medal-emblem .medal-svg { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
.medal-emblem--32 { width: 24px; height: 32px; }
.medal-emblem--44 { width: 34px; height: 44px; }
.medal-emblem--56 { width: 44px; height: 56px; }
.medal-emblem--120 { width: 96px; height: 120px; }
.medal-emblem--32 img, .medal-emblem--32 .medal-svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.medal-emblem__count { position: absolute; right: -6px; bottom: -2px; min-width: 20px; padding: 1px 5px; border: 1px solid var(--border-gold); border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--gold-200); font: 600 12px/1.4 var(--font-sans); text-align: center; }

.medal-summary { margin: -6px 0 14px; }
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.medal-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: var(--shadow-1); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.medal-card:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.medal-card__stage { position: relative; display: flex; align-items: center; justify-content: center; height: 176px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-3); }
.medal-card__stage .medal-emblem { z-index: 1; transition: transform .25s ease; }
.medal-card__body { flex: 1; padding: 14px 16px 4px; text-align: center; }
.medal-card__name { margin: 0 0 6px; color: var(--text-primary); font: 600 14px/1.3 var(--font-sans); }
.medal-card__desc { margin: 0; color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; }
.medal-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 14px; }
.medal-card__foot .ribbon { width: 54px; height: 16px; }
.medal-card__count { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--accent-subtle); color: var(--gold-200); font: 600 12px/1.2 var(--font-sans); }
.medal-card__count--zero { background: transparent; box-shadow: inset 0 0 0 1px var(--border-subtle); color: var(--text-muted); }
.medal-card__edit { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--surface-raised); }
@media (hover: hover) {
  .medal-card__edit { opacity: 0; transition: opacity .15s ease; }
  .medal-card:hover .medal-card__edit, .medal-card__edit:focus-visible { opacity: 1; }
}

@media (max-width: 560px) {
  .medal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .medal-card__stage { height: 124px; }
  .medal-card__stage::after { bottom: 8px; width: 60px; }
  .medal-card__stage .medal-emblem--120 { width: 68px; height: 86px; }
  .medal-card__body { padding: 10px 10px 2px; }
  .medal-card__name { font-size: 13px; }
  .medal-card__desc { font-size: 11.5px; }
  .medal-card__foot { padding: 10px; }
  .medal-card__foot .ribbon { width: 42px; height: 13px; }
}

.medal-cell { display: inline-flex; align-items: center; gap: 10px; }

.medal-form { display: flex; gap: 20px; align-items: flex-start; }
.medal-form__side { display: flex; flex: none; flex-direction: column; align-items: center; gap: 12px; width: 170px; }
.medal-form__preview { display: flex; align-items: center; justify-content: center; width: 170px; height: 200px; padding: 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-3); }
.medal-form__preview img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); }
.medal-form__placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-muted); font-size: 11px; line-height: 1.4; text-align: center; }
.medal-form__placeholder .medal-svg { width: 64px; height: 92px; opacity: .55; filter: grayscale(.4); }
.ribbon-preview { display: block; width: 96px; height: 26px; border-radius: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .3); }
@media (max-width: 640px) {
  .medal-form { flex-direction: column; align-items: stretch; }
  .medal-form__side { width: 100%; }
  .medal-form__preview { width: 100%; height: 170px; }
}

.medal-list { display: flex; flex-direction: column; margin: 0; padding: 0 16px 8px; list-style: none; }
.medal-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.medal-list li:first-child { border-top: 0; }
.medal-list__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 2px; }
.medal-list__name .ribbon { width: 36px; height: 11px; }

.rec-list { display: flex; flex-direction: column; gap: 12px; }
.rec-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border-subtle); border-left: 3px solid var(--warning); border-radius: var(--radius-md); background: var(--surface-1); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.rec-card--accepted { border-left-color: var(--success); }
.rec-card--rejected { border-left-color: var(--text-disabled); opacity: .8; }
.rec-card__head { display: flex; align-items: center; gap: 12px; }
.rec-card__name { font: 600 14px/1.3 var(--font-sans); color: var(--text-primary); }
.rec-card__decide { margin: 0; }
.rec-card__decide .input { min-width: 180px; }

.vmodel-list { display: flex; flex-direction: column; margin: 0; padding: 0 16px 10px; list-style: none; }
.vmodel-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.vmodel-list li:first-child { border-top: 0; }
.vmodel-list li.is-allowed .ic { color: var(--success-fg); }
.vmodel-list li.is-locked { color: var(--text-muted); }
.vmodel-list li.is-locked .ic { color: var(--text-disabled); }

.iad-timeline { display: flex; flex-direction: column; gap: 10px; position: relative; }
.iad-entry { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-1); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.iad-entry--interrogation { border-left: 3px solid var(--warning); }
.iad-entry--evidence { border-left: 3px solid var(--info); }
.iad-entry--status { border-left: 3px solid var(--gold-400); background: var(--accent-subtle); }
.iad-entry--discipline { border-left: 3px solid var(--danger); background: var(--danger-subtle); }
.iad-entry__discipline { margin: 6px 0; }
.iad-entry__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-default); }
.iad-entry__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 13px; color: var(--text-primary); }
