/* My TC Workshop — approved look: Dark Brown leads, orange accents, cream background. */
:root {
  --brown: #3A2E29;
  --brown-2: #5C4C45;
  --gold: #FDBB16;
  --orange: #FE7311;
  --amber: #FF8C13;
  --teal: #0D9BA3;
  --gray: #EEEAEB;
  --cream: #FBF5EC;
  --white: #FFFFFF;
  --danger: #A8321E;
  --ok: #2F7D4F;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--brown); font-family: "Montserrat", system-ui, sans-serif; font-size: 15px; line-height: 1.45; }
a { color: var(--brown); font-weight: 700; }
a:hover { color: #000; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.boot { padding: 60px 24px; text-align: center; font-weight: 600; }
.muted { color: #6E5F58; }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 12px 22px; font-weight: 800; cursor: pointer; text-decoration: none; background: var(--orange); color: var(--brown); min-height: 44px; }
.btn:hover { background: var(--amber); color: var(--brown); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--white); border: 1.5px solid var(--brown); }
.btn.secondary:hover { background: var(--gray); }
.btn.dark { background: var(--brown); color: var(--cream); }
.btn.dark:hover { background: #000; color: var(--cream); }
.btn.danger { background: var(--white); color: var(--danger); border: 1.5px solid var(--danger); }
.btn.sm { padding: 7px 12px; min-height: 34px; font-size: 13px; font-weight: 700; }
.link-btn { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* Sign in */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-brand { background: var(--brown); color: var(--cream); padding: 56px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.auth-brand .wordmark { font-size: 44px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.card { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 28px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  border: 1.5px solid #CFC6C2; border-radius: 10px; padding: 11px 13px; background: var(--white); font-weight: 500; width: 100%; min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brown); outline: none; box-shadow: 0 0 0 3px rgba(253,187,22,.45); }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }
.msg { padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.msg.err { background: #FBE7E2; color: var(--danger); }
.msg.ok { background: #E3F2E8; color: var(--ok); }
.msg.info { background: var(--white); border: 1px solid var(--gold); }

/* Shell */
.wordmark { font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: .5px; }
.rule { width: 40px; height: 3px; background: var(--gold); }
.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--brown) 236px, var(--cream) 236px); }
.side { width: 236px; flex-shrink: 0; background: var(--brown); color: var(--cream); display: flex; flex-direction: column; padding: 32px 18px; gap: 28px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }
.side .brand .by { font-size: 12px; font-weight: 600; }
.side .brand .tag { font-size: 14px; font-weight: 600; margin-top: 6px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--cream); }
.nav a:hover { background: rgba(255,255,255,.08); color: var(--cream); }
.nav a.on { background: var(--orange); color: var(--brown); font-weight: 700; }
.nav .sep { height: 1px; background: rgba(251,245,236,.18); margin: 10px 8px; }
.side .motto { margin-top: auto; padding: 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 3px; line-height: 2; }
.main { flex: 1; min-width: 0; padding: 22px 40px 48px; display: flex; flex-direction: column; gap: 22px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.crumbs { font-size: 14px; font-weight: 500; }
.top-right { display: flex; align-items: center; gap: 18px; }
.lang { display: inline-flex; border: 1.5px solid var(--brown); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 5px 11px; font-weight: 700; font-size: 13px; cursor: pointer; min-height: 32px; }
.lang button.on { background: var(--brown); color: var(--cream); }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--orange); color: var(--brown); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.menu-btn { display: none; background: none; border: 0; color: var(--cream); cursor: pointer; padding: 6px; }

/* Home */
.hello h1 { font-size: 40px; font-weight: 800; letter-spacing: -.5px; }
.hello p { margin: 4px 0 0; font-size: 20px; font-weight: 500; }
.cols { display: flex; gap: 24px; align-items: flex-start; }
.cols > .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero { background: var(--brown); color: var(--cream); border-radius: 16px; padding: 28px 32px; display: flex; flex-direction: column; gap: 10px; }
.pill { align-self: flex-start; background: var(--gold); color: var(--brown); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; padding: 5px 12px; border-radius: 999px; text-transform: uppercase; }
.hero .t1 { font-size: 16px; font-weight: 600; }
.hero .t2 { font-size: 32px; font-weight: 800; line-height: 1.1; }
.hero .t3 { font-size: 22px; font-weight: 800; }
.bar { width: 100%; max-width: 360px; height: 10px; background: var(--brown-2); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--orange); border-radius: 999px; }
.bar.light { background: var(--gray); }
.notice { display: flex; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--gold); border-radius: 12px; padding: 14px 18px; font-size: 14px; font-weight: 600; }
.notice > span:last-child { flex: 1; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-h h2 { font-size: 22px; font-weight: 800; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile { background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray); display: flex; flex-direction: column; }
.tile .head { height: 64px; display: flex; align-items: center; padding: 0 16px; font-size: 22px; font-weight: 800; }
.tile .head.o { background: var(--orange); }
.tile .head.b { background: var(--brown); color: var(--cream); }
.tile .head.g { background: var(--gold); font-size: 18px; }
.tile .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile .name { font-size: 16px; font-weight: 800; }
.aside { width: 280px; flex-shrink: 0; background: var(--white); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.aside h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.aside a.item { display: block; background: var(--cream); border-radius: 12px; padding: 14px 16px; text-decoration: none; }
.aside a.item:hover { background: #F4EADB; }
.aside .item .a { font-size: 15px; font-weight: 800; }
.aside .item .b { font-size: 13px; font-weight: 500; margin-top: 2px; }

/* Course */
.module { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); overflow: hidden; }
.module > .mh { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--gray); }
.module .num { width: 40px; height: 40px; border-radius: 10px; background: var(--brown); color: var(--cream); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.module.locked .num { background: var(--gray); color: var(--brown); }
.module .mt { font-weight: 800; font-size: 17px; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; text-decoration: none; font-weight: 600; border-top: 1px solid var(--gray); }
.lesson-row:first-of-type { border-top: 0; }
.lesson-row:hover { background: var(--cream); }
.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #CFC6C2; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tick.done { background: var(--orange); border-color: var(--orange); }
.lesson-row .lt { flex: 1; }

/* Lesson */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.res-list { display: flex; flex-direction: column; gap: 8px; }
.res { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--cream); border-radius: 10px; text-decoration: none; }
.res:hover { background: #F4EADB; }
.res .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--brown); color: var(--cream); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.res .rn { font-weight: 700; }
.res .rd { font-weight: 500; font-size: 13px; }

/* Coach's Corner */
.q { border-top: 1px solid var(--gray); padding: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.q:first-child { border-top: 0; padding-top: 0; }
.status { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--gray); }
.status.open, .status.new { background: var(--gold); }
.status.answered, .status.contacted { background: #D7EFF0; color: #075E63; }
.reply { background: var(--cream); border-left: 3px solid var(--orange); padding: 10px 12px; border-radius: 6px; font-weight: 500; white-space: pre-wrap; }
.pre { white-space: pre-wrap; font-weight: 500; }

/* Admin */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--gray); }
.tabs a { padding: 10px 16px; text-decoration: none; font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.on { border-color: var(--orange); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input[type=text] { max-width: 320px; }
.toolbar select { width: auto; }
.table-wrap { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; padding: 12px 14px; background: #F6F1EA; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid var(--gray); vertical-align: top; }
td .sub { font-size: 12px; color: #6E5F58; font-weight: 500; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .8px; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
.badge.on { background: #E3F2E8; color: var(--ok); }
.badge.off { background: var(--gray); }
.badge.warn { background: #FFF1CC; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--white); border: 1px solid var(--gray); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-size: 28px; font-weight: 800; }
.stat .l { font-size: 13px; font-weight: 600; }

/* Dialog */
.overlay { position: fixed; inset: 0; background: rgba(58,46,41,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.dialog { background: var(--white); border-radius: 16px; padding: 26px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { font-size: 22px; font-weight: 800; }
.pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; background: var(--cream); border: 2px dashed var(--gold); border-radius: 10px; padding: 14px; text-align: center; letter-spacing: .5px; user-select: all; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.copybox { background: var(--cream); border-radius: 10px; padding: 12px; white-space: pre-wrap; font-size: 13px; font-weight: 500; }

/* Phone and tablet */
@media (max-width: 1100px) {
  .cols { flex-direction: column; }
  .aside { width: 100%; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px; }
  .auth-brand .wordmark { font-size: 32px; }
  .shell { flex-direction: column; background: var(--cream); }
  .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; padding: 12px 16px; gap: 0; flex-direction: column; }
  .side .brand { flex-direction: row; align-items: center; justify-content: space-between; padding: 0; }
  .side .brand .by, .side .brand .tag, .side .brand .rule, .side .motto { display: none; }
  .side .wordmark { font-size: 18px; }
  .side .wordmark br { display: none; }
  .menu-btn { display: inline-flex; }
  .nav { display: none; padding-top: 12px; }
  .side.open .nav { display: flex; }
  .main { padding: 16px 16px 40px; }
  .hello h1 { font-size: 30px; }
  .hello p { font-size: 17px; }
  .hero { padding: 22px; }
  .hero .t2 { font-size: 26px; }
  .grid3 { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .who .nm { display: none; }
  .crumbs { font-size: 13px; }
  .notice { flex-wrap: wrap; }
}

/* ---------- community ---------- */
.bell { position: relative; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--brown); min-height: 40px; }
.bell-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 999px; background: var(--orange); color: var(--brown); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.notice-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.notice-item { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; border: 1px solid var(--gray); }
.notice-item.unread { background: var(--cream); border-color: var(--gold); }
.notice-item .nt { font-weight: 700; }
.notice-item .nb { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.banner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--white); border: 2px solid var(--orange); border-radius: 16px; padding: 18px 22px; }
.banner-t { font-size: 18px; font-weight: 800; }
.banner-b { font-size: 14px; font-weight: 500; margin-top: 4px; white-space: pre-wrap; }
.composer { display: flex; flex-direction: column; gap: 8px; }
.ta-wrap { position: relative; }
.compose-ta { min-height: 90px; }
.compose-ta.sm { min-height: 60px; }
.compose-bar { display: flex; align-items: center; gap: 6px; }
.tool-btn { background: var(--white); border: 1.5px solid #CFC6C2; border-radius: 8px; min-height: 34px; min-width: 40px; padding: 4px 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.tool-btn:hover { border-color: var(--brown); }
.tray { width: 100%; max-width: 100%; border: 1px solid var(--gray); border-radius: 12px; padding: 10px; background: var(--white); display: flex; flex-wrap: wrap; gap: 4px; overflow: hidden; }
.tray input { margin-bottom: 8px; }
.emoji { background: none; border: 0; font-size: 22px; width: 38px; height: 38px; border-radius: 8px; cursor: pointer; }
.emoji:hover { background: var(--cream); }
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; width: 100%; max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.gif-cell { position: relative; display: block; width: 100%; height: 100px; padding: 0; border: 0; background: var(--gray); border-radius: 8px; overflow: hidden; cursor: pointer; }
.gif-cell img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
.giphy-credit { width: 100%; text-align: right; font-size: 11px; font-weight: 700; color: #6E5F58; }
.gif-prev { display: flex; align-items: center; gap: 10px; }
.gif-prev img { width: auto; height: auto; max-width: 160px; max-height: 140px; object-fit: contain; border-radius: 8px; }
.mention-pop { position: absolute; left: 8px; bottom: calc(100% + 4px); z-index: 30; background: var(--white); border: 1px solid #CFC6C2; border-radius: 10px; box-shadow: 0 8px 24px rgba(58,46,41,.18); min-width: 240px; max-width: 90vw; overflow: hidden; }
.mention-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; text-align: left; cursor: pointer; font-weight: 600; }
.mention-opt.on, .mention-opt:hover { background: var(--cream); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; flex-shrink: 0; }
.avatar.team { background: var(--brown); color: var(--cream); }
.thread-list { display: flex; flex-direction: column; margin-top: 14px; }
.thread { border-top: 1px solid var(--gray); padding: 14px 0; }
.post { display: flex; gap: 10px; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-body { margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; font-weight: 500; }
.post-gif { margin-top: 8px; width: auto; height: auto; max-width: min(260px, 100%); max-height: 240px; object-fit: contain; border-radius: 10px; display: block; }
.mention { background: #FFF1CC; border-radius: 4px; padding: 0 3px; font-weight: 700; }
.replies { margin-left: 40px; display: flex; flex-direction: column; gap: 10px; }
.replies:not(:empty) { margin-top: 10px; border-left: 3px solid var(--gray); padding-left: 12px; }
.thread-actions { margin: 8px 0 0 40px; }
.reply-box { margin: 8px 0 0 40px; }
.flash { animation: flash 2s ease; border-radius: 10px; }
@keyframes flash { 0% { background: #FFF1CC; } 100% { background: transparent; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--gray); border-radius: 999px; padding: 6px 12px; text-decoration: none; font-weight: 600; font-size: 14px; }
.session-list { display: flex; flex-direction: column; gap: 12px; }
.session { display: flex; flex-direction: column; gap: 10px; }
.session-head { display: flex; gap: 12px; align-items: center; }
.date-chip { width: 54px; height: 58px; border-radius: 12px; background: var(--brown); color: var(--cream); display: flex; align-items: center; justify-content: center; text-align: center; flex-shrink: 0; font-weight: 800; }
.date-chip .dm { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.date-chip .dd { font-size: 22px; line-height: 1; }
.session .mt { font-weight: 800; font-size: 17px; }
.lbl { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #6E5F58; margin-bottom: 2px; }
.hw { border: 1px solid var(--gray); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.hw-submit summary { cursor: pointer; font-weight: 700; }
.hw-submit[open] { display: flex; flex-direction: column; gap: 8px; }
.mh { flex-wrap: wrap; }
@media (max-width: 820px) {
  .replies, .thread-actions, .reply-box { margin-left: 16px; }
  .banner { flex-direction: column; align-items: flex-start; }
  .gif-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 240px; }
  .gif-cell { height: 84px; }
  .gif-prev img { max-width: 120px; max-height: 110px; }
  .post-gif { max-height: 200px; }
  .mention-pop { left: 0; right: 0; min-width: 0; }
  .emoji { width: 40px; height: 40px; }
}
